bug in nvidia shader compiler?

hi use this simple shader program:

vertex shader

 
void main() {
  gl_TexCoord[0] = gl_MultiTexCoord0;
  gl_Position = ftransform();
}

fragment shader

 
void main() {
   uniform sampler2D brush;
\
   gl_FragColor = vec4(texture2D(brush, gl_TexCoord[0].xy).xx, 0.0, 0.0);
} 

If I comment the texture access in the fragment shader out there is no error but otherwise I get a segmentation fault(0x411d02c0 in _nv000098gl () from /usr/lib/libGLcore.so.1) in the opengl library if I link the shader program. I have written simular shader which are working.

The card is a nv40 with eeh 7676 linux driver.

thanks and regards

marco

Try to put the uniform definition before the main. The linking should work then.

kon

P.S.:
OpenGL Shading Language

Originally posted by kon:
Try to put the uniform definition before the main. The linking should work then.

Thank you, this is the bug.

regards

marco