Known bugs in OpenGL 3, OpenGL 4 implementations
Asked Answered
D

2

9

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.

Disenfranchise answered 27/11, 2010 at 14:17 Comment(3)
The question should be community wiki.Boltonia
@Stringer - only mods can make questions CW now. It will still convert when >30 answers are posted.Pectoralis
I'm a strong supporter of an initiative listing 'known drivers bugs', but I think SO may not be the right place to be efficient. A starting point may be the OpenGL Wiki, but such a database would need searching, indexing, driver versions lists and such, it would need a proper database backend.Suborder
D
2

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).

Disenfranchise answered 27/11, 2010 at 14:17 Comment(2)
The use of gl_ in front of any variable name except pre-defined ones is forbidden; according to the spec, you should get a compiler error.Durnan
@Nicol, that's true but not relevant to this problem. Please read again :)Disenfranchise
H
1

Another gl_VertexID bug:

  • GPU: NVIDIA GeForce 9400M
  • Type: GLSL problem
  • Driver version: NVDANV50Hal 1.6.36
  • OpenGL version: 2.1, GLSL 1.2 using GL_EXT_gpu_shader4 extension

This occurs on Macbooks. It's possible that the new driver enabling OpenGL 3.2 that comes with OS X Lion has fixed the issue but a lot of frameworks are only configured to use the legacy 2.1 drivers so this is still relevant.

If you read gl_VertexID before you read another attribute in a vertex shader, the latter attribute will return junk data. If the other attribute is gl_Color, regardless of how it is used, nothing will be rendered. Accessing other built-in attributes can lead to other strange behavior.

  • Workaround:

If you must use gl_VertexID, read all other attributes you will need first. If you read another attribute first, followed by gl_VertexID, any subsequent reads of the attribute will work fine.

Hengel answered 27/11, 2010 at 14:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.