View Full Version : Can Indirect Buffer be held in VAO?

09-15-2014, 09:52 PM
I following the OpenGL Super Bible and just got to the section on indirect buffers. Can these be stored in the vao?

If I generate and bind a buffer to GL_ELEMENT_ARRAY_BUFFER the draw command glDrawElements will properly use it when the vao is rebound. However if I generate and bind a buffer to GL_DRAW_INDIRECT_BUFFER the command glDrawElementsIndirect will not use my indirect buffer when the vao is bound again. I must manually bind it again using glBindBuffer. Is this normal?

Dark Photon
09-16-2014, 05:38 AM
...indirect buffers. Can these be stored in the vao?

No, the bindings for indirect buffers are not stored in a VAO.

In the OpenGL Specification (https://www.opengl.org/registry/doc/glspec44.compatibility.pdf), search for "Vertex Array Object State". This will take you directly to a table that defines what bindings/settings are maintained by a VAO: Basically the bindings/enables/settings for vertex arrays and element index list.

Immediately after that, there is a table "Vertex Array Data (not in Vertex Array objects)" which details some batch state which is "not" contained within a VAO. You'll notice that the DRAW_INDIRECT_BUFFER_BINDING is in this list.