cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

danny02
Journeyman III

[Bug] GLSL wrong compile error

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

0 Likes
3 Replies
berserker
Journeyman III

try this:

FragColor = toGamma( dot(N, L));

0 Likes

sry I didn't ask my question right.

What I was wondering about was why I don't get a helpfull compile error from OpenGL, but only from the

GPU Shader Analyzer Tool.

So I was thinking that there might be a bug in the error report code of the AMD OpenGL driver.

0 Likes

It's not a very helpful error is it? GSA is using an older driver verion (12.4, I think) and not the driver on your system. I'm guessing your system driver doesn't have as good error reporting. If you've got a newer than 12.4 driver installed this sounds like a bit of a backward step for the GL driver.

0 Likes