Bug in nvidia GLSL implementation?


I have used
uniform float blah = 1.0;
which is wrong. My fault but the nvidia driver compiled without to complain and with the default value of 0.0. This is really annoying. Is there a reason why I can’t set the default value of a uniform? I can write varyings in the FS too which is AFAIK really againt the spec.



PS how long can be a VS on a nv40? 512 or 2^16 instructions?

PPS I use version 76.64 under linux

I think the reason it allows it (in linux, i use the same driver) is because it’s really the Cg compiler under the hood, and it allows these sorts of things. In windows there is a way I believe, to turn on ‘strict’ compilation of GLSL shaders, making the compiler conform to the GLSL specs. I dunno if there is a way to do this in linux. I wish there was :slight_smile: As well as the “write program object assembly” option.

Hi Marco,

Fenris is partially correct, there is a way to turn on ‘strict’ compilation using nvidia drivers in Windows. This does not, however, prevent the shader from compiling. It gives mostly ambiguous warning messages that may leave you scratching your head. If you want to check a shader to see if it is compliant to the GLSL specification, you should run your shader through GLSL Validate . This little application has a specification conformant compiler front end with a nice, simple GUI wrapped around it. You simply feed it a shader and it will tell you if it is syntactically correct or not. You do not need OpenGL drivers, or even a video card with GLSL support to use this utility.

There are a couple of developer tools that you may also appreciate. Shader Designer integrates GLSL Validate into its shader development environment and GLIntercept integrates it into its OpenGL Shading Language debugging software.


Thanks for the help. I use the Shader Compiler Frontend from 3Dlabs under Linux which is great. The other tools are not (freely) available. I would like have something like the ogldebug under IRIX but Linux is still second class in this area. I use bugle but it’s not working every time.

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