[Mesa-dev] [PATCH 8/8] mesa: use gl_vert_attrib enum type in more places

Brian Paul brianp at vmware.com
Mon Jan 29 20:42:54 UTC 2018


Slightly better readbility.
---
 src/mesa/main/arrayobj.c |  2 +-
 src/mesa/main/varray.c   | 12 ++++++------
 src/mesa/main/varray.h   |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index ea9b316..1951638 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -231,7 +231,7 @@ _mesa_reference_vao_(struct gl_context *ctx,
 static void
 init_array(struct gl_context *ctx,
            struct gl_vertex_array_object *vao,
-           GLuint index, GLint size, GLint type)
+           gl_vert_attrib index, GLint size, GLint type)
 {
    struct gl_array_attributes *array = &vao->VertexAttrib[index];
    struct gl_vertex_buffer_binding *binding = &vao->BufferBinding[index];
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 6c022b4..b2783e2 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -132,7 +132,7 @@ type_to_bit(const struct gl_context *ctx, GLenum type)
 static void
 vertex_attrib_binding(struct gl_context *ctx,
                       struct gl_vertex_array_object *vao,
-                      GLuint attribIndex,
+                      gl_vert_attrib attribIndex,
                       GLuint bindingIndex)
 {
    struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex];
@@ -294,7 +294,7 @@ get_array_format(const struct gl_context *ctx, GLint sizeMax, GLint *size)
 void
 _mesa_update_array_format(struct gl_context *ctx,
                           struct gl_vertex_array_object *vao,
-                          GLuint attrib, GLint size, GLenum type,
+                          gl_vert_attrib attrib, GLint size, GLenum type,
                           GLenum format, GLboolean normalized,
                           GLboolean integer, GLboolean doubles,
                           GLuint relativeOffset)
@@ -1063,7 +1063,7 @@ _mesa_VertexAttribLPointer(GLuint index, GLint size, GLenum type,
 void
 _mesa_enable_vertex_array_attrib(struct gl_context *ctx,
                                  struct gl_vertex_array_object *vao,
-                                 unsigned attrib)
+                                 gl_vert_attrib attrib)
 {
    assert(attrib >= VERT_ATTRIB_GENERIC0);
    assert(attrib < ARRAY_SIZE(vao->VertexAttrib));
@@ -1965,7 +1965,7 @@ _mesa_VertexAttribDivisor_no_error(GLuint index, GLuint divisor)
 {
    GET_CURRENT_CONTEXT(ctx);
 
-   const GLuint genericIndex = VERT_ATTRIB_GENERIC(index);
+   const gl_vert_attrib genericIndex = VERT_ATTRIB_GENERIC(index);
    struct gl_vertex_array_object * const vao = ctx->Array.VAO;
 
    assert(genericIndex < ARRAY_SIZE(vao->VertexAttrib));
@@ -1996,7 +1996,7 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
 {
    GET_CURRENT_CONTEXT(ctx);
 
-   const GLuint genericIndex = VERT_ATTRIB_GENERIC(index);
+   const gl_vert_attrib genericIndex = VERT_ATTRIB_GENERIC(index);
    struct gl_vertex_array_object * const vao = ctx->Array.VAO;
 
    if (!ctx->Extensions.ARB_instanced_arrays) {
@@ -2856,7 +2856,7 @@ _mesa_print_arrays(struct gl_context *ctx)
 
    fprintf(stderr, "Array Object %u\n", vao->Name);
 
-   unsigned i;
+   gl_vert_attrib i;
    for (i = 0; i < VERT_ATTRIB_MAX; ++i) {
       const struct gl_array_attributes *array = &vao->VertexAttrib[i];
       if (!array->Enabled)
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index 79ecd9a..fe7eb81 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -96,7 +96,7 @@ _mesa_set_drawing_arrays(struct gl_context *ctx,
 extern void
 _mesa_update_array_format(struct gl_context *ctx,
                           struct gl_vertex_array_object *vao,
-                          GLuint attrib, GLint size, GLenum type,
+                          gl_vert_attrib attrib, GLint size, GLenum type,
                           GLenum format, GLboolean normalized,
                           GLboolean integer, GLboolean doubles,
                           GLuint relativeOffset);
@@ -104,7 +104,7 @@ _mesa_update_array_format(struct gl_context *ctx,
 extern void
 _mesa_enable_vertex_array_attrib(struct gl_context *ctx,
                                  struct gl_vertex_array_object *vao,
-                                 unsigned attrib);
+                                 gl_vert_attrib attrib);
 
 extern void
 _mesa_bind_vertex_buffer(struct gl_context *ctx,
-- 
2.7.4



More information about the mesa-dev mailing list