i have a problem. when use GLSL on the ATI HD 3850

hello.

i use opengl 3.3.10524 version and glew.

and i saw this error.


Fragment shader fail to compile with the following errors:
ERROR : 0:2: error(#138) ‘varying in’ supported in geometry shaders only

this code is my fragment shader. just simply cartoon effect.

varying in vec3 normal;

void main(void)
{
vec3 Id = normalize( vec3(gl_LightSource[0].position) );
float ity = dot( Id, normal );
vec4 fc;
if( ity > 0.95 ) fc = 1.00 * gl_Color;
else if( ity > 0.50 ) fc = 0.50 * gl_Color;
else if( ity > 0.25 ) fc = 0.25 * gl_Color;
else fc = 0.10 * gl_Color;
gl_FragColor = fc;
}


what`s problem?

i knew HD 3850 (Graphic Driver 9.12 over) is Support for OpenGL Shading Language 1.50 and my Graphic Driver Catalyst 11.2 !!

need help !!

i knew HD 3850 (Graphic Driver 9.12 over) is Support for OpenGL Shading Language 1.50 and my Graphic Driver Catalyst 11.2 !!

Yes, but “varying in” is not actual grammar according to the OpenGL Shading Language. A variable can be “varying” (but only with the compatibility flag or in a compatibility context) or “in”; it cannot be both.

The compiler isn’t really providing a useful message though, since “varying in” isn’t supported by any stage.

thanks for answer to my bad english :slight_smile:
and maybe… i can not exactly understand your answer…
but my fragment shader… clean compiled on Geforce GT415M and running…
it is hardware dependency?

clean compiled on Geforce GT415M and running…

NVIDIA’s compilers generally are more accepting of off-spec behavior than ATI’s.

thank you for help :slight_smile:

have a nice day lol