gl_VertexID in GLSL 120 on OSX?

I get this error with a 120 GLSL shader in a GL2 context, on OSX Lion:

Failed to compile vertex shader.
ERROR: 0:15: Use of undeclared identifier ‘gl_VertexID’
ERROR: 0:16: Use of undeclared identifier ‘gl_VertexID’

Yet the docs say gl_VertexID has always been supported:

Sounds like a bug. Have you reported it to Apple? They’re usually pretty good about responding to issues, though it might be a while before it’s resolved.

That man page is wrong. gl_VertexID is not supported in 1.10 or 1.20 (go check the real documentation.)

You can use gl_VertexID in 1.10 or 1.20 with
#extension GL_EXT_gpu_shader4 : require

or, use 1.40 or 1.50 where gl_VertexID is part of the language.

See also the caveats in the specification about gl_VertexID only being well-defined when your vertex data is in a VBO, not wrapped in a display list, etc.

That should really be corrected then.

Khronos has a public bugzilla where you can tell them to fix their broken man page.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.