Why do I get this error compiling a GLSL geometry shader?
ERROR: 0:15: 'gl_VerticesIn' : undeclared identifier
Here's the shader:
// makes wireframe triangles.
#version 330
#extension GL_ARB_geometry_shader4 : enable
layout(triangles) in;
layout(line_strip, max_vertices = 4) out;
void main(void)
{
for (int i = 0; i < gl_VerticesIn; i++)
{
gl_Position = gl_in[i].gl_Position;
EmitVertex();
}
gl_Position = gl_in[0].gl_Position;
EmitVertex();
EndPrimitive();
}
Seems straightforward to me, but I can't find much information on "gl_VerticesIn", which I thought was supposed to be a built-in. If I just replace "gl_VerticesIn" with "3", everything works.
I'm using a GeForce GTX 765M and OpenGL 3.3 core profile. I don't have this error using any other GPU. My drivers are up to date.