2009/6/17 Stefan Dösinger stefan@codeweavers.com:
If I have to choose between a compile failure or disabling some clipplanes I'll throw the clipplanes under the bus.
If the shader is using relative addressing, look at the highest directly addressed constant register. We know that the constant array must be at least highest_idx+1 elements large, otherwise the shader will fail for sure. If we see this problem coming, only enable as many clipplanes as we can fit into the hardware limit.
Something similar should be done in GLSL, but GLSL can only support all clipplanes or none at all.
I don't think we want this for GLSL. ARB is your own responsibility, but personally I think compile errors are much nicer to debug than the kind of graphics glitches missing clipplanes will create.
Am Wednesday 17 June 2009 20:24:19 schrieb Henri Verbeet:
I don't think we want this for GLSL. ARB is your own responsibility, but personally I think compile errors are much nicer to debug than the kind of graphics glitches missing clipplanes will create.
They may be nicer to debug, but they're not nice to play with. I'm not really talking about bugs in our code where we don't account for the amount of clip plane uniforms correctly. This patch is intended for cases where we actually need all the uniforms for the D3D shader.
Specifically, Trackmania nations has a vertex shader that uses indirect addressing, two int constants and references c253. We need one for the position fixup and 255 constants for the D3D code. If we write gl_ClipVertex in GLSL that will break the shader. We get a nice explanation why it failed though.