compileProgram validates against opengl state
Brought to you by:
mcfletch
The compileProgram function calls check_validate on the newly linked program object which can lead to a situation where
validation fails due to an incompatible gl state, yet there are no errors reported in either compiling or linking.
Validation should only be performed before *using* the shader program - so as to check whether or not the shader will execute correctly with the current opengl state and not to be used as an indication of compilation success.
If validation fails due to an incompatible state, but shader compilation and linking succeeds, it causes a catch-22 because the function throws an error and you can't change the state if you aren't returned the linked program.
"RuntimeError: Validation failure (0): Validation failed! - Different sampler types for same sample texture unit in fragment shader." <- Validation can fail despite there being nothing wrong with shader compilation or linking.
I agree with xwize. And the solution is very simple, just remove 'program.check_validate()' from 'compileProgram' function in the file OpenGL.GL.shaders.py. I think this line is logically wrong.
Please read:
http://www.opengl.org/discussion_boards/showthread.php/167784-ati-and-shadow-texture-lockups
http://lists.apple.com/archives/mac-opengl/2007/Nov/msg00061.html