PDA

View Full Version : Validation fails



V-man
04-01-2005, 11:32 AM
I have a GLSL shader that compiles without errors, but validation fails. When I try to render stuff, nothing gets rendered except for other objects that use other valid shaders. Calling glGetError after glDrawElements gives GL_INVALID_OPERATION.

How do I solve this?

I tried a RenderMonkey version, but I had to make a monor modification since texture coord 1 isn't present in the 3DS models.
It compiles and runs fine in RenderMonkey.

If I run the shader as written in RM, validation still fails so I don't understand what's bugging it.

ZbuffeR
04-01-2005, 01:08 PM
Did you checked it with GLSL validate : http://developer.3dlabs.com/downloads/index.htm

mrbill
04-01-2005, 01:37 PM
Originally posted by V-man:

If I run the shader as written in RM, validation still fails so I don't understand what's bugging it.Try glValidateProgramARB( handle ) or glValidateProgram( name ), then check the infolog with glGetInfoLogARB( handle, ... ) or glGetProgramInfoLog( name, ... ) and print the log.

The most common problem is not setting sampler uniforms correctly so that two or more samplers of different type (example: sampler2D, samplerCube, sampler2DShadow) are pointing to the same texture unit (often 0).

(RenderMonkey never sets two samplers to the same unit.)

-mr. bill

V-man
04-01-2005, 02:09 PM
Yes, programming error on my part due to fast typing :)

2 samples with same texture unit.

If I call validate after using glUniform, then the info log string may be different than before the call to validate?

mrbill
04-01-2005, 03:15 PM
Originally posted by V-man:
If I call validate after using glUniform, then the info log string may be different than before the call to validate?Of course, you've changed the state by using glUniform (especially if you change a sampler uniform), so validate would pass and the info log string will tell you that.

-mr. bill