I am having a problem with the use of matrices.
I need to add a matrix to a set of shaders in a program I’m working on but due to the program structure I can’t define a new uniform because I have no control over the use of shaders. They can get swapped at any point so I have no means to ensure that a uniform matrix I set remains valid until it gets eventually used. This program needs to work with extension-less GL 2.0 so I can use no uniform buffers or other newer features.
The only way I see to solve this dilemma is to use one of the built in matrices and the only ones available to me are gl_TextureMatrix - gl_TextureMatrix.
I have used gl_TextureMatrix now and on my Geforce 8600GT card all seems to work fine.
Can I expect any trouble with such a non-conventional setup? The program never uses texture units 4 and above so they will always be inactive.