Handling VAOs in GL 4.5 with DSA

Started by
13 comments, last by Xycaleth 9 years, 7 months ago

This doesn't work either. Again, no errors.

GLuint vao = 0;
    glGenVertexArrays(1, &vao);
    glBindVertexArray(vao);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[2]);
    glEnableVertexAttribArray(0);
    glEnableVertexAttribArray(1);

    glBindVertexBuffer(0, buffers[0], 0, 0);
    glVertexAttribFormat(0, 3, GL_FLOAT, GL_FALSE, 0);
    glVertexAttribBinding(0, 0);

    glBindVertexBuffer(1, buffers[1], 0, 0);
    glVertexAttribFormat(1, 2, GL_FLOAT, GL_FALSE, 0);
    glVertexAttribBinding(1, 1);
Advertisement
Try explicitly setting the stride on the vertex buffer. Sounds like a driver bug to me.

It works after explicitly setting the stride to 12 and 8. So what, is this confirmed for broken drivers?

From http://www.opengl.org/wiki/Vertex_Specification, which makes sense:

Separate attribute format (ARB_vertex_attrib_binding)
...
Notice that the stride is uncoupled from the vertex format itself here. Also, stride? can no longer be 0. This is because OpenGL doesn't know the format of the data yet, so it can't automatically compute it.

Ah right, I thought the stride could still be inferred when the binding index and attribute index were linked! Reading the extension spec again, I had misread a sentence which was referring to glVertexAttribPointer, not to the stride for vertex buffers.

So no, not a driver bug, it sounds like it's working as intended.

This topic is closed to new replies.

Advertisement