mesa: Make gl_vertex_array contain pointers to first order VAO members.

Instead of keeping a copy of the vertex array content in
struct gl_vertex_array only keep pointers to the first order
information originaly in the VAO.
For that represent the current values by struct gl_array_attributes
and struct gl_vertex_buffer_binding.

v2: Change comments.
    Remove gl... prefix from variables except in the i965 directory where
    it was like that before. Reindent because of that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
This commit is contained in:
Mathias Fröhlich
2018-03-04 18:15:53 +01:00
parent d62f0df354
commit 64d2a20480
27 changed files with 478 additions and 435 deletions

View File

@@ -284,9 +284,6 @@ unbind_array_object_vbos(struct gl_context *ctx, struct gl_vertex_array_object *
for (i = 0; i < ARRAY_SIZE(obj->BufferBinding); i++)
_mesa_reference_buffer_object(ctx, &obj->BufferBinding[i].BufferObj, NULL);
for (i = 0; i < ARRAY_SIZE(obj->_VertexArray); i++)
_mesa_reference_buffer_object(ctx, &obj->_VertexArray[i].BufferObj, NULL);
}
@@ -462,21 +459,8 @@ void
_mesa_update_vao_derived_arrays(struct gl_context *ctx,
struct gl_vertex_array_object *vao)
{
GLbitfield arrays = vao->NewArrays;
/* Make sure we do not run into problems with shared objects */
assert(!vao->SharedAndImmutable || vao->NewArrays == 0);
while (arrays) {
const int attrib = u_bit_scan(&arrays);
struct gl_vertex_array *array = &vao->_VertexArray[attrib];
const struct gl_array_attributes *attribs =
&vao->VertexAttrib[attrib];
const struct gl_vertex_buffer_binding *buffer_binding =
&vao->BufferBinding[attribs->BufferBindingIndex];
_mesa_update_vertex_array(ctx, array, attribs, buffer_binding);
}
}