Mesa (master): vbo: get rid of needless NR_MAT_ATTRIBS constant

Brian Paul brianp at kemper.freedesktop.org
Tue Oct 13 14:58:04 UTC 2015


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

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Oct 12 11:26:16 2015 -0600

vbo: get rid of needless NR_MAT_ATTRIBS constant

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/vbo/vbo_context.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index 802955d..b5dc45c 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -33,7 +33,6 @@
 #include "vbo.h"
 #include "vbo_context.h"
 
-#define NR_MAT_ATTRIBS 12
 
 static GLuint check_size( const GLfloat *attr )
 {
@@ -108,14 +107,12 @@ static void init_mat_currval(struct gl_context *ctx)
       &vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT];
    GLuint i;
 
-   assert(NR_MAT_ATTRIBS == MAT_ATTRIB_MAX);
-
-   memset(arrays, 0, sizeof(*arrays) * NR_MAT_ATTRIBS);
+   memset(arrays, 0, sizeof(*arrays) * MAT_ATTRIB_MAX);
 
    /* Set up a constant (StrideB == 0) array for each current
     * attribute:
     */
-   for (i = 0; i < NR_MAT_ATTRIBS; i++) {
+   for (i = 0; i < MAT_ATTRIB_MAX; i++) {
       struct gl_client_array *cl = &arrays[i];
 
       /* Size is fixed for the material attributes, for others will
@@ -175,7 +172,7 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx )
       for (i = 0; i < ARRAY_SIZE(vbo->map_vp_none); i++) 
 	 vbo->map_vp_none[i] = i;
       /* map material attribs to generic slots */
-      for (i = 0; i < NR_MAT_ATTRIBS; i++) 
+      for (i = 0; i < MAT_ATTRIB_MAX; i++)
 	 vbo->map_vp_none[VERT_ATTRIB_GENERIC(i)]
             = VBO_ATTRIB_MAT_FRONT_AMBIENT + i;
 




More information about the mesa-commit mailing list