http://bugs.winehq.org/show_bug.cgi?id=14031
--- Comment #2 from Tobias Jakobi liquid.acid@gmx.net 2008-06-21 14:41:35 --- (In reply to comment #1)
Unfortunately, as of now I know very little about shaders, so where shaders are involved I can't help much, I'm afraid. Stefan or Roderick may know more about this. I may hazard a guess that some advanced d3d9 features are poorly supported on Geforce FX series GPUs, because some opengl features emulation relies on are not present on them and/or an alternative codepath is needed that is not implemented.
Thanks, so I should CC them? I'm asking this because it seems like I'm forcing the people to look at this bug...
With functions applyign states call stack usually is quite useless. State changes made by some d3d calls are cached internally by wined3d then are applied when it becomes necessary - usually before primitives are rendered or something. If you are interested in collecting more info on this bug, hacking the function to print some values is more useful. state and bumpmap are the ones that are important there.
I added FIXME("NV_TEXTURE_SHADER_NV debug: bump is %u and active texture unit is %x\n", bumpmap, gl_nv_texture_shader_debug_helper()); in front of the glTexEnv call.
It turned out that when the call fails I have this configuration: fixme:d3d:texture_activate_dimensions NV_TEXTURE_SHADER_NV debug: bump is 0 and active texture unit is 84c4 fixme:d3d:texture_activate_dimensions >>>>>>>>>>>>>>>>> GL_INVALID_OPERATION (0x502) from glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, ...) @ utils.c / 3427
84c4 is GL_TEXTURE4_ARB, so it's always this texture unit which does trouble. As you can see bump is always zero when this happens, so the call glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D) is failing.
Quote from texture_shader.txt: 1) INVALID_OPERATION is generated when TexEnv is called and the PREVIOUS_TEXTURE_INPUT_NV parameter for texture unit i is assigned the value TEXTUREi_ARB where f i is greater than or equal to the current active texture unit. Could be the problem...
2) INVALID_OPERATION is generated when TexEnv is called and the SHADER_OPERATION_NV parameter for texture unit 0 is assigned one of OFFSET_TEXTURE_2D_NV, OFFSET_TEXTURE_2D_SCALE_NV, OFFSET_TEXTURE_RECTANGLE_NV, OFFSET_TEXTURE_RECTANGLE_SCALE_NV, DEPENDENT_AR_TEXTURE_2D_NV, DEPENDENT_GB_TEXTURE_2D_NV, DOT_PRODUCT_NV, DOT_PRODUCT_DEPTH_REPLACE_NV, DOT_PRODUCT_TEXTURE_2D_NV, DOT_PRODUCT_TEXTURE_RECTANGLE_NV, DOT_PRODUCT_TEXTURE_CUBE_MAP_NV, DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, DOT_PRODUCT_REFLECT_CUBE_MAP_NV. or DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV. No, coz we're calling it with GL_TEXTURE_2D
3) INVALID_OPERATION is generated when TexEnv is called and the SHADER_OPERATION_NV parameter for texture unit 1 is assigned one of DOT_PRODUCT_DEPTH_REPLACE_NV, DOT_PRODUCT_TEXTURE_2D_NV, DOT_PRODUCT_TEXTURE_RECTANGLE_NV, DOT_PRODUCT_TEXTURE_CUBE_MAP_NV, DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, DOT_PRODUCT_REFLECT_CUBE_MAP_NV, or DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV. No, same as above...
4) INVALID_OPERATION is generated when TexEnv is called and the SHADER_OPERATION_NV parameter for texture unit 2 is assigned one of DOT_PRODUCT_TEXTURE_CUBE_MAP_NV, DOT_PRODUCT_REFLECT_CUBE_MAP_NV, or DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV. Again no...
5) INVALID_OPERATION is generated when TexEnv is called and the SHADER_OPERATION_NV parameter for texture unit n-1 (where n is the number of supported texture units) is assigned either DOT_PRODUCT_NV or DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV. Another no!
Quote from texture_shader.txt: (nothing here, because it's almost identical)
So if it's no enclosing glBegin/glEnd pair it should be a problem like the one described in (1).
Ah yes Alexander, you meant stage not state, right?
Greets, Tobias