RenderingPipeline

from geometry to pixels

First hints of OpenGL 4 on MacOS X?

No Mac currently supports more than OpenGL 3.2 even tho all current Macs could support OpenGL 4.x. Apple doesn’t comment on this situation but it seems, that at least some features of newer GL versions made it into the drivers.

The lastest GLSL version MacOS supports is 150, at least that’s what

glGetString(GL_SHADING_LANGUAGE_VERSION)

tells us. Earlier OSX versions were very picky when it came to the corresponding #version string in the shader sources in OpenGL 3.2 core profile: only 150 was allowed, even 140 and 130 were tabu. Now, at least 140 gets accepted. But to my big surprise, even newer versions are now accepted!

With #version 330, explicit attribute locations are accepted. They work in the way that they actually set the initial location bindings, but if there was an explicit attribute location in the shader source,¬†glBindAttribLocation doesn’t work anymore – so be careful if you want to use this feature.

#version 400 and #410 are also accepted (probably even bigger news). With OpenGL 4.0, double values were added to GLSL and those are now accepted by the driver. On a HD4000 using doubles for a simple diffuse lighting drops the framerate from over 400 FPS to 8 – and adds strange artefacts:

Left: calculated with doubles, right: with floats. Note that the left version is not just the blue channel, the texture has no influence at all.

While the performance goes down, the CPU load goes up from 7% to 100%, so I assume the driver drops back to software rendering on my machine.

Keep in mind, that all versions of GLSL other than 150 are still buggy, even 140 behaves wrongly as it claims that ‘inverse’ was not a defined function even tho it was added for version 140¬†(and works fine on 150).

m4s0n501

, , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*