I'm on a Mac, using Swift, and using OpenGL 3.2. I'm also using XCode 6.1 Beta so I suppose that's the most likely explanation, because it doesn't seem to me like this makes sense.
I can't find any evidence that this shouldn't be supported, but this fragment shader is resulting in the error Invalid call of undeclared identifier 'texture2D'
during compilation:
#version 150
uniform sampler2D usTexture;
in vec2 vTextureCoord;
out vec4 FragColor;
void main() {
vec4 color = texture2D(usTexture, vTextureCoord);
FragColor = color;
}
#version 150
can only mean#version 150 core
. On other platforms where compatibility profiles are implemented, you can continue to use things that were deprecated beginning in GLSL 1.30 such astexture2D
if you write#version 150 compatibility
. You really don't want that, but it's worth mentioning ;) – Fid