gl_InstanceID attribute location is not -1 when queried.

Discussion created by nesister on Oct 17, 2010
Latest reply on Oct 18, 2010 by frali


the OpenGL 3.3 doc for glGetAttribLocation states that "if name starts with the reserved prefix "gl_", a value of -1 is returned.". This fails with latest catalyst 10.9, at least with 'gl_InstanceID'.

This simple program, when successfuly compiled and linked reports gl_InstanceID attribute at location 0, and 'position' at location 1.


vertex shader:


#version 330

in vec3 position;

uniform mat4x4 modelview[2];

void main() {

    gl_Position = modelview[gl_InstanceID] * vec4(position, 1);



fragment shader:


#version 330

void main() {

    gl_FragColor = vec4(1, 0, 0, 1);


This is basically the same issue as here :