Mesa (master): mesa: rename gl_vertex_array_object::_VertexAttrib -> _VertexArray

Brian Paul brianp at kemper.freedesktop.org
Tue Feb 6 22:49:33 UTC 2018


Module: Mesa
Branch: master
Commit: e7a4536e648b37f10a4501f9d295be70b8900269
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7a4536e648b37f10a4501f9d295be70b8900269

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Feb  5 09:33:58 2018 -0700

mesa: rename gl_vertex_array_object::_VertexAttrib -> _VertexArray

Since the type is gl_vertex_array.  Update comment to explain that
these arrays are only used by the VBO module.

Also rename some local variables in _mesa_update_vao_derived_arrays().

Reviewed-by: Mathias Fröhlich <mathias.froehlich at web.de>

---

 src/mesa/main/arrayobj.c      | 13 ++++++-------
 src/mesa/main/attrib.c        |  2 +-
 src/mesa/main/mtypes.h        |  4 ++--
 src/mesa/vbo/vbo_exec_array.c |  2 +-
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 360d097ec1..a6fa33c82c 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -283,8 +283,8 @@ 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->_VertexAttrib); i++)
-      _mesa_reference_buffer_object(ctx, &obj->_VertexAttrib[i].BufferObj, NULL);
+   for (i = 0; i < ARRAY_SIZE(obj->_VertexArray); i++)
+      _mesa_reference_buffer_object(ctx, &obj->_VertexArray[i].BufferObj, NULL);
 }
 
 
@@ -453,14 +453,13 @@ _mesa_update_vao_derived_arrays(struct gl_context *ctx,
 
    while (arrays) {
       const int attrib = u_bit_scan(&arrays);
-      struct gl_vertex_array *client_array = &vao->_VertexAttrib[attrib];
-      const struct gl_array_attributes *attrib_array =
+      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[attrib_array->BufferBindingIndex];
+         &vao->BufferBinding[attribs->BufferBindingIndex];
 
-      _mesa_update_vertex_array(ctx, client_array, attrib_array,
-                                buffer_binding);
+      _mesa_update_vertex_array(ctx, array, attribs, buffer_binding);
    }
 }
 
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index a9e4a11d7d..8ac5db062f 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1503,7 +1503,7 @@ copy_array_object(struct gl_context *ctx,
    /* skip RefCount */
 
    for (i = 0; i < ARRAY_SIZE(src->VertexAttrib); i++) {
-      _mesa_copy_vertex_array(ctx, &dest->_VertexAttrib[i], &src->_VertexAttrib[i]);
+      _mesa_copy_vertex_array(ctx, &dest->_VertexArray[i], &src->_VertexArray[i]);
       _mesa_copy_vertex_attrib_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]);
       _mesa_copy_vertex_buffer_binding(ctx, &dest->BufferBinding[i], &src->BufferBinding[i]);
    }
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b6d606386e..4d6b771411 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1603,9 +1603,9 @@ struct gl_vertex_array_object
     * Derived vertex attribute arrays
     *
     * This is a legacy data structure created from gl_array_attributes and
-    * gl_vertex_buffer_binding, for compatibility with existing driver code.
+    * gl_vertex_buffer_binding, only used by the VBO module at this time.
     */
-   struct gl_vertex_array _VertexAttrib[VERT_ATTRIB_MAX];
+   struct gl_vertex_array _VertexArray[VERT_ATTRIB_MAX];
 
    /** Vertex attribute arrays */
    struct gl_array_attributes VertexAttrib[VERT_ATTRIB_MAX];
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index b30e044a87..9ce0aa38dc 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -332,7 +332,7 @@ recalculate_input_bindings(struct gl_context *ctx)
    struct vbo_context *vbo = vbo_context(ctx);
    struct vbo_exec_context *exec = &vbo->exec;
    const struct gl_vertex_array_object *vao = ctx->Array.VAO;
-   const struct gl_vertex_array *vertexAttrib = vao->_VertexAttrib;
+   const struct gl_vertex_array *vertexAttrib = vao->_VertexArray;
    const struct gl_vertex_array **inputs = &exec->array.inputs[0];
 
    /* May shuffle the position and generic0 bits around */




More information about the mesa-commit mailing list