AnsweredAssumed Answered

[Bug] GLSL wrong compile error

Question asked by danny02 on Jan 26, 2013
Latest reply on Feb 6, 2013 by coordz

Hi I encountered a strange bug with getting shader compile errors with OpenGL.

I have this small shader:

 

#define toGamma(x) pow(x, vec4(1./2.2))

in vec3 normal;

out vec4 FragColor;

 

void main()

{

          vec3 N = normalize(normal);

          vec3 L = normalize(vec3(0,1,1));

          FragColor = toGamma( dot(N, L); //<-- 2 errors

}

 

when I compiled this I got the following "empty" error message, from the call to glGetShaderInfoLog:

"Fragment shader failed to compile with the following errors:"

 

when I try to compile the code with AMDs "GPU Shader Analyzer", I get a much more helpful message:

ERROR: 0:12: error(#111) EOF in Macro toGamma

ERROR: 0:12: error(#131) Syntax error: pre-mature EOF parse error

ERROR: error(#273) 2 compilation errors.  No code generated

 

 

Is there something I do wrong?

 

my system:

Win 7 x64, AMD 5770

Outcomes