EBO binding using DSA
EDIT:
Coming from non-DSA I still had an "unbind buffers" function at the end of each render iteration. It unbound the vertex buffer, element buffer and then the vertex array. Meaning it unbound the VBO/EBO from the VAO. Changing that function to only unbind the VAO instead fixed everything.
Original post below for posterity:
I'm using DSA to create VAO/VBO/EBO, and when drawing you don't have to bind the VBO because it's now tied to the VAO using glVertexArrayVertexBuffer, which works great.
I thought that when binding an EBO using glVertexArrayElementBuffer the same would go for the EBO. But if I try that I get a GL_INVALID_OPERATION error with the message "Some kind of element buffer must be bound."
Trying to bind an EBO (before drawing) with just one 0 in it (to try and see if "some kind" really means "some kind") fails as well. If I bind the actual EBO for the object it works fine.
Am I mistaken in thinking you can use DSA to forego binding the EBO at draw time like you can the VBO? I can't find anything on it...
Posted Jul 21, 2022, 11:54 AM UTC · edited
Does this help? Victor Gordan shows how to use DSA, helped me a ton! https://m.youtube.com/watch?v=cadzqhqPqVA
I've seen that video. At 2:24 there's a snippet of the drawing code; it only binds the VAO there. Which is what I'm doing, yet I'm getting the error.
To note I'm using glMultiDrawElementsIndirect instead of glDrawElements, but that shouldn't matter no?