I have a shader with a bool uniform:
uniform bool u_Bool;
Since there is no initializer, I expect its initial value to be 0. From the GLSL 1.5 spec:
The link time initial value is either the value of the variable’s initializer, if present, or 0 if no initializer is present.
After linking, I query the value with glGetUniformiv and receive 13 not 0. Furthermore, the if statement in the shader that checks the uniform evaluates to false so it’s as if the value is actually 0 but 13 is returned.
I’ve tried both glGetUniformiv and glGetUniformfv using GLSL 1.1 and 1.5. I am running NVIDIA GeForce 9 on Windows Vista 64-bit with 191.07 drivers. Has anyone experienced anything similar?