Re: [6/6] WineD3D: Emulate clipplanes in ARB if the NV extensions are not available
2009/6/17 Stefan Dösinger <stefan(a)codeweavers.com>:
+ //ERR("Using texcoord %u for clip\n", ps->clipplane_emulation); C99 features generally aren't allowed inside Wine code.
+ if(!device->vs_clipping) + { + /* See if we can use fragment.texcoord[7] for clipplane emulation + * + * Don't do this if it is not supported, or fragment.texcoord[7] is used + */ + if(This->baseShader.reg_maps.shader_version.major < 3) + { + for(i = GL_LIMITS(texture_stages); i > 0; i--) + { + if(!This->baseShader.reg_maps.texcoord[i - 1]) + { + This->clipplane_emulation = i; + break; + } + } + } + else + { + for(i = GL_LIMITS(texture_stages); i > 0; i--) + { + if(!This->baseShader.reg_maps.input_registers & (1 << (i - 1))) + { + This->clipplane_emulation = i; + break; + } + } + } + } This is specific to ARB as well.
+ char clipplane_emulation; Using a char for this is pretty useless. If you want to save memory or cachelines, use a bitfield. The compiler will just pad the structure for alignment, and if you add other elements below it you'll have a hole, like e.g. after vpos_uniform in the same structure.
Am Wednesday 17 June 2009 20:24:26 schrieb Henri Verbeet:
2009/6/17 Stefan Dösinger <stefan(a)codeweavers.com>:
+ //ERR("Using texcoord %u for clip\n", ps->clipplane_emulation);
C99 features generally aren't allowed inside Wine code. Ooops. Didn't intend to keep the commented out debug line.
+ if(!device->vs_clipping) + { ... + }
This is specific to ARB as well. The intention was to use it to deal with broken gl_ClipVertex support on Apple drivers - ie, to add the same texcoord based clipping to GLSL as a fallback if gl_ClipVertex does not work. Now you already said you considered this something Apple should fix - my point is just that the clipplane search code is not useless for GLSL
2009/6/17 Stefan Dösinger <stefan(a)codeweavers.com>:
This is specific to ARB as well. The intention was to use it to deal with broken gl_ClipVertex support on Apple drivers - ie, to add the same texcoord based clipping to GLSL as a fallback if gl_ClipVertex does not work. Now you already said you considered this something Apple should fix - my point is just that the clipplane search code is not useless for GLSL
I t could of course be moved, if needed.
participants (2)
-
Henri Verbeet -
Stefan Dösinger