PDA

View Full Version : gl_VertexID in GLSL 120 on OSX?



JoshKlint
11-16-2011, 02:42 PM
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:
http://www.opengl.org/sdk/docs/manglsl/xhtml/gl_VertexID.xml

malexander
11-16-2011, 03:36 PM
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.

https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/wa/signIn

arekkusu
11-16-2011, 06:31 PM
That man page is wrong. gl_VertexID is not supported in 1.10 or 1.20 (go check the real documentation (http://www.opengl.org/documentation/specs/).)

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.

JoshKlint
11-17-2011, 10:18 AM
That should really be corrected then.

arekkusu
11-17-2011, 06:56 PM
Khronos has a public bugzilla (http://www.khronos.org/bugzilla/) where you can tell them to fix their broken man page.