mesa: use gl_vert_attrib enum type in more places
authorBrian Paul <brianp@vmware.com>
Tue, 30 Jan 2018 18:02:06 +0000 (11:02 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 30 Jan 2018 18:02:43 +0000 (11:02 -0700)
Slightly better readbility.

Reviewed-by: Gert Wollny <gw.fossdev@gmail.com>
src/mesa/main/arrayobj.c
src/mesa/main/varray.c
src/mesa/main/varray.h

index b95aeec9d71949451fdd30a1fde3886f1763be93..7208f4c534fd8c12e0e197a818af2877d24aef0e 100644 (file)
@@ -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)
 {
    assert(index < ARRAY_SIZE(vao->VertexAttrib));
    struct gl_array_attributes *array = &vao->VertexAttrib[index];
index 6c022b479f4cce162eea364c4620312811e708df..b2783e24b49dd24d1319cd3d3ef2cf38243064e9 100644 (file)
@@ -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)
index 79ecd9a03741fd906d3da44d3bfc819d5d530aec..fe7eb816319d84a090c1741cc5dcd1285d0dd519 100644 (file)
@@ -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,