[Mesa-dev] [PATCH] mesa: attach ElementArrayBufferObj to vertex array object

Brian Paul brianp at vmware.com
Tue Nov 22 10:16:26 PST 2011


On 11/22/2011 01:38 AM, Yuanhan Liu wrote:
> This would make ElementArrayBufferObj data per vertex array object. I did't
> find something to support this at the spec page[0]. But I did find
> something that somehow support this at opengl wiki page[1].
>
> NOTE: with my test, both NV and ATI's closed source opengl
> implementation would attach the Elelemnt array buffer to vao.
>
> This would fix most of(3 left) intel oglc vao test fail
>
> [0]: http://www.opengl.org/registry/specs/ARB/vertex_array_object.txt
> [1]: http://www.opengl.org/wiki/Vertex_Array_Object

Back when I implemented Apple's VAO it wasn't clear to me if the array 
element binding was per-VAO or per-context.  The original spec wasn't 
explicit about it.  But I just checked the GL 3.0 spec it lists 
GL_ELEMENT_ARRAY_BUFFER as per-VAO state.  A test program on NVIDIA's 
driver confirms it.

Regarding your patch, I think we could remove the existing 
gl_array_attrib::ElementArrayBufferObj field and reference 
gl_array_object::ElementArrayBufferObj everywhere.

Note that even if we don't support GL_ARB/APPLE_vertex_array_object 
that we still have/use the default VAO so there's shouldn't be a 
problem if the VAO extensions aren't enabled.

The fix for this would probably also be a candidate for the 7.11 branch.

We should have a piglit test for this too.

-Brian


More information about the mesa-dev mailing list