KhronosGroup / OpenGL-API

OpenGL and OpenGL ES API Issue Tracker
34 stars 5 forks source link

DSA queries for VAOs are incomplete. #42

Closed NicolBolas closed 4 years ago

NicolBolas commented 5 years ago

GL 4.5/ARB_DSA has some oddities in how it accesses vertex array object data.

First, there's this, from the definition of glGetVertexArrayIndexed:

An INVALID_VALUE error is generated if index is greater than or equal to the value of MAX_VERTEX_ATTRIBS

OK, fine... except that this function also takes GL_VERTEX_BINDING_OFFSET, which is supposed to be indexed by binding index, not attribute index. So GL_MAX_VERTEX_ATTRIBS is the wrong limit to use.

The other problem is that this API does not provide DSA queries for the following (most of which are vertex binding values rather than vertex attribute values):

Basically glGetVertexArrayIndexed cannot completely replace the need for binding the VAO and using glGetVertexAttribIiv/glGetIntegeri_v.

An interesting note is that ARB_direct_state_access explicitly says that glGetVertexArrayIndexed should be added to the "Get Command" in table 23.4 for GL_VERTEX_BINDING_STRIDE. So clearly someone thought that this function should be able to access the binding stride at least.

pdaniell-nv commented 5 years ago

Yikes, it does seems all this is not specified. FWIW the NVIDIA driver implements all the missing queries above. There must have been a disconnect between the GL_ARB_vertex_attrib_binding spec, EXT_dsa spec, ARB_dsa spec and the core spec.

Someone will need to figure out all the missing bits for OpenGL 4.6 to complete this specification.

pdaniell-nv commented 5 years ago

Addressing the issue internally here: https://gitlab.khronos.org/opengl/API/issues/108

oddhack commented 5 years ago

Fixed internally - this will show up in the next public spec update.

oddhack commented 4 years ago

Fixed in the 2019-10-22 spec updates (hopefully - this was a fairly complex issue, please check).