问题
I'm following the arcsynthesis tutorials on OpenGL 3.3 using 10.8 Mountain Lion and when building the project it compiles and runs the shaders using GLSL version 3.30, however even in the core profile on Mac OS 10.8 I shouldn't have GLSL 3.30 support - only 1.50 (as highlighted in the picture)
Is anybody able to explain how I have managed to achieve this black magic?
回答1:
OS X 10.8 still only support OpenGL 3.2, but with some 3.3 features such as specifying attribute location (#extension GL_ARB_explicit_attrib_location : enable)
. The shader compiler accepts versions up to 4.10. They might have left it there for compatibility or (SPECULATION) they originally intended to support 4.1.
This is at least my conclusion after a few weeks with 10.8.
EDIT: Looks like the 4.10 speculations were spot on. 10.9-10.12 support up to version 4.10. I guess they wanted to spend resources on their Metal api rather than moving forward and get compute shaders in..
来源:https://stackoverflow.com/questions/11964416/mac-os-10-8-supports-glsl-3-30