1

I recently encountered a known OpenGL compatibility bug that has since been fixed. Whilst searching for the resolution I found this answer describing the issue in detail, however I am unable to find any references in the 3.2 or 3.3 (compatibility) specifications that say array zero must be enabled.

The answer says that wording in OpenGL 4.3 was changed to clarify and fix this bug, but does not cite any text or sections where that wording was located. I have read through specific areas and am only able to find this change in OpenGL 4.5 that may be related:

Setting any generic vertex attribute updates the current values of the attribute. In addition, setting generic vertex attribute zero specifies a vertex, as described in section 10.7.21.

This used to exclude vertex attrib array zero, but has since been changed to "any" generic vertex attribute, thus including vertex attribute zero.

Where and which OpenGL specifications mandate that vertex attrib array zero must be enabled? Secondly, where can I read the change in the 4.3 specification that clarifies this specific issue?

HenryK4
  • 13
  • 3
  • The main point is that in earlier GL versions, the `glDraw*` commands were actually defined in terms of immediate mode `glVertex()` commands, which implicitely means without attribute 0 (aliased to vertex position), no vertex will be specified, hence nothing will be drawn. Have a look at [this answer here](https://stackoverflow.com/a/28157559/2327517). – derhass Jan 17 '20 at 19:40

1 Answers1

2

I am unable to find any references in the 3.2 or 3.3 (compatibility) specifications that say array zero must be enabled.

As I pointed out in detail in this answer, the requirement of vertex attribute 0 is implied by the behavior of the glDraw* commands being defined as equal to a sequence of immediate mode render commands, where the glVertex command (aliased to attribute index 0) actually creates the vertex sent to the pipeline.

You can find this language in the compatibility profile (and only there) spec of for example OpenGL 3.2 in section 2.8.1 "Drawing Commands", and it is there until GL 4.2 compat (section has been just renamed to 2.8.2 there).

With GL4.3, the spec was overhauled completely, and the language completely changed. There is now no reference to immediate mode when drawing with vertex arrays in compat profiles, just as it has been removed from core profiles earlier already. Section 10.5 "Drawing Commands Using Vertex Arrays" is now basically identical between core and compat profiles, regarding this matter.

derhass
  • 43,833
  • 2
  • 57
  • 78