idr
02-05-2007, 06:46 AM
I've either discovered a bug in Nvidia's GLSL compiler, or I'm misunderstanding the intention of __VERSION__. I have a shader that I want to compile differently depending on the supported shading language version. One path uses transpose (introduced in 1.20), and the other path does not. I have the following at the start of my shader:
#if __VERSION__ >= 120
#define USE_TRANSPOSE_PATH
#version 120
#endifHowever, even on a compiler that supports 1.20, this path is never activiated. If I move the #version statement before the #if, it gets activated. This seems counter intuitive, and somewhat useless. I looked at the GLSL 1.20 spec, and it seems to indicate that __VERSION__ should be 120 regardless of any #version statement.
What's the real scoop?
#if __VERSION__ >= 120
#define USE_TRANSPOSE_PATH
#version 120
#endifHowever, even on a compiler that supports 1.20, this path is never activiated. If I move the #version statement before the #if, it gets activated. This seems counter intuitive, and somewhat useless. I looked at the GLSL 1.20 spec, and it seems to indicate that __VERSION__ should be 120 regardless of any #version statement.
What's the real scoop?