Specifying the GLSL version gives a syntax error when using LWJGL. I haven't tried to reproduce this issue outside LWJGL. This is happening on multiple Macs running Lion.
I've gotten both vertex and fragment shaders to work without using #version
. But I'm about to use the texture
function, which seems to require a #version
directive.
Here's the simplest failing example:
#version 120
void main() {
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}
Compiling this fragment shader and calling glGetShaderInfoLog
gives this error:
ERROR: 0:1: '' : syntax error #version
Replacing 120
with anything else, such as 110
, also gives an error. Curiously, though, if I use 130 or higher, it gives the same error plus a complaint about the version not beig supported. (i know my system doesn't have GLSL 1.3, but it's still weird that this error displays when the compiler is acting like it doesn't understand the version tag.)
I'm on a Mac with an ATI Radeon HD 4670. GL_VERSION
is 2.1 ATI-7.12.9
and GL_SHADING_LANGUAGE_VERSION
is 1.20
.
Given that, I don't see any reason why GLSL 1.20 should be unavailable. And it's really weird to me that it's saying #version
is a syntax error, as opposed to saying something about an unsupported GLSL version.