i-photon
10-10-2010, 07:55 PM
If I declare and use a uniform variable in a vertex shader, link it in a program with a geometry and fragment shader that do not have declarations of said variable, why does glGetUniformLocation return -1 for it?
The same thing happens if all 3 have the declaration, but only one or two use it for anything. In my case, all 3 must do something with the uniform in order for the compiler to consider it "active".
Oddly though, if I don't attach a geometry shader this problem does not occur.
The problem is: I've used the uniform and it therefore affects the output. However, I cannot obtain a location index for it. Why?
The same thing happens if all 3 have the declaration, but only one or two use it for anything. In my case, all 3 must do something with the uniform in order for the compiler to consider it "active".
Oddly though, if I don't attach a geometry shader this problem does not occur.
The problem is: I've used the uniform and it therefore affects the output. However, I cannot obtain a location index for it. Why?