Shader Validation problems on ATI X800XT

Having left it alone for some time I thought today would be a good day to go back and hack away at my GLSL Shadow Mapping code in an attempt to make it a bit more sane than I left it, so i fired up my old project and poked at it a bit so instead of using the 1.00 GLSL interface it was now using the new GLSL1.10 interface via GL2.0.

I ran the program it was reduced to a crawl, with my FPS counter reporting 1 => 2fps… “Odd”, thinks I, “I havent touched the shaders and my X800XT should be faster than my 9800XT was… whats going on”.

So, I poked and fiddled and in the end found that it was infact my shadow map program which was causing the problems as it was spitting out the following error :
Link successful. The GLSL vertex shader will run in hardware. The GLSL fragment shader will run in hardware. Validation failed - samplers of different types are bound to the same texture image unit.

Now, I’ve no idea what that means :frowning: So I was wondering if anyone can shead any light on the problem? As I said, the code worked fine on my 9800xt via the 1.00GLSL extension and i havent touched it in months;

uniform sampler2DShadow shadowMap;
uniform sampler2D lightTex;

varying vec4 projCoord;

const vec4 ambient = vec4(0.13), boost = vec4(1.06);

void main()
{
	vec4 lightValue = texture2DProj(lightTex, projCoord);
	vec4 shadowValue = shadow2DProj(shadowMap, projCoord);
	gl_FragColor = boost * gl_Color * lightValue * shadowValue + ambient;
}  

The error is thrown up after I load the shaders, compile and link them but before I start my main loop so i’ve not tried to supply values to the uniforms or owt

Hardware details;
gfx : X800XT PE
driver : Cat5.3
ogl version : 2.0.4955
OS : WinXP

Originally posted by bobvodka:
The error is thrown up after I load the shaders, compile and link them but before I start my main loop so i’ve not tried to supply values to the uniforms or owt
You need to assign each sampler to an image unit with glUniform() before you try to validate the state. Otherwise all samplers have the value 0 as default, which means all will try to read from unit 0, which will cause this conflict when they are of different types. If they were the same type, then they would just sample the same texture, which is OK, but usually not what you want either.

ah, that makes sense and means i’m probably some way off the mark as to why both my shadow mapping examples run terrible…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.