Search code examples
openglglsldriversopengl-3

Known bugs in OpenGL 3, OpenGL 4 implementations


As we all get to know eventually, the specification is one thing and the implementation is another. Most of bugs we cause ourselves, but sometimes that's not the case.

I believe it'd be useful to make a small list of:

What are the currently known bugs in the GPU drivers, related to the implementation of recent versions of OpenGL and GLSL?

Please remember to always post the relevant graphics card and driver version.


Solution

  • Let me start:

    • GPU: confirmed on AMD/ATI Radeon HD 4650
    • Type: GLSL problem
    • GL version related: confirmed on 3.3, probably 3.1 and up (or even before)
    • Relevant link: http://forums.amd.com/devforum/messageview.cfm?catid=392&threadid=139288
    • Driver version: confirmed on Catalyst 10.10 (9-28-2010)
    • Status: as of 2010-11-27 it has a fix, but it aparrently didn't reach the public driver release yet (so even if the fix gets released, users with not-so-recent version of drivers will still be affected for like months)
    • Description:

    If in your vertex shader you have any attribute (in) variable whose name is lexically after gl_, then you cannot use built-in attributes, namely gl_VertexID and gl_InstanceID. If you try, the shader won't work (blank screen, likely).

    • Workaround (new):

    Only available with GLSL 3.3 and up, or with the GL_ARB_explicit_attrib_location extension.

    Define any attribute's location explicitly to be equal to 0, by appending layout(location=0) to its declaration in the vertex shader. You may, but don't need to use this for other attributes; the important thing is that ANY attribute needs to have location equal to 0. After you do that, the naming is no longer important.

    • Workaround (alternative):

    Use a name convention which requires you to name your attribute variables starting with a_, which won't hurt your code readability and will make all of them be lexically before gl_ (safe zone).