PDA

View Full Version : bug in nvidia shader compiler?



marco_dup1
09-27-2005, 04:35 AM
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;\n\
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

kon
09-27-2005, 05:48 AM
Try to put the uniform definition before the main. The linking should work then.

kon

P.S.:
OpenGL Shading Language (http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=forum;f=11)

marco_dup1
09-27-2005, 06:08 AM
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