Jason Green wrote:
This is a resend of the earlier patch, with one addition:
- previously, the line to alias the program.env[] to C[] was done in
the vertex shaders since that was the only function that needed them (and it needs to be done to support relative addressing). However, with PS 2.0+, pixel shaders now need to be able to use relative addressing as well. This can't be done with ARB_fragment_program, but it can be done with GLSL, so for consistency, we are now aliasing the program.env[] array to C[] for both ps & vs.
I think I've mislead you here (sorry)... the relative addressing on PS 3.0+ is on input registers, against aL, not on constants. I think it allows you to read the inputs in a loop against the loop counter. According to spec, pixel shader constants still do not allow relative addressing. So, this constant aliasing thing... we likely don't need this in pixel shaders. However, I still think that it'd be nice to use the same names (so we can share more code), and put this kind of initialization in baseshader if possible. From that point of view I agree w/ the patch, as long as nothing breaks.