Hello friends!
I have a strange behaviour with my glsl code..
I am trying to pass a simple 'uint' variable between stages (from vertex shader to fragment shader), but it seems like I'm doing something wrong.
I have an interface block like this:
// Vertex Shader
out InterfBlock {
vec4 WorldPos;
vec3 WorldNormal;
vec2 TexCoord[2];
vec3 CamDir;
uint DrawID;
} OUT;
//Fragment Shader
in InterfBlock {
vec4 WorldPos;
vec3 WorldNormal;
vec2 TexCoord[2];
vec3 CamDir;
uint DrawID; // This line is the problem, works if I remove.
} IN;
When I run my program, it simply generates no error.
(There is an error checker already that uses glGetShaderInfoLog() and works when I simply forget to put a semicolon, so I know it works,)
But also my GpuProgram class gives me the number of Uniforms in my shaders. But it says 0 (zero). (But there are a few uniforms)
The strange thing is, the shader works perfectly when I simply remove the "uint DrawID;" from FRAGMENT SHADER.. (Also shows the correct amount of Uniforms if I remove).
It doesn't matter if I keep it in Vertex Shader, it works. But when I add the line "uint DrawID;" in interface block of frag shader, It stops working.
Any ideas?
Edit:
NVIDIA Driver Version: 331.113
OS: Linux-x86_64
OpenGL version from glxinfo: 3.3.0 NVIDIA 331.113