mesa: remove MAX_VERTEX_PROGRAM_ATTRIBS
authorBrian Paul <brianp@vmware.com>
Fri, 22 May 2009 13:30:05 +0000 (07:30 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 22 May 2009 13:30:05 +0000 (07:30 -0600)
Use MAX_VERTEX_GENERIC_ATTRIBS instead.  No need for two #defines for
the same quantity.

src/mesa/main/config.h
src/mesa/main/dlist.c
src/mesa/shader/arbprogparse.c
src/mesa/shader/arbprogram.c
src/mesa/tnl/t_vb_program.c

index 100caff7bf0456b02b1c0b474e2e77662270c261..5a05a65396ac62196ca6e242579ff8c10c9e8731 100644 (file)
 /** For GL_ARB_vertex_program */
 /*@{*/
 #define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
-#define MAX_VERTEX_PROGRAM_ATTRIBS     16
 /*@}*/
 
 /** For GL_ARB_fragment_program */
index 782f847904e580b742ecb88a01a01fdf9d375dc7..5120e516e08bee4d006b8ef00b9a28960f754947 100644 (file)
@@ -4883,7 +4883,7 @@ save_Attr1fNV(GLenum attr, GLfloat x)
       n[2].f = x;
    }
 
-   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 1;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
 
@@ -4905,7 +4905,7 @@ save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y)
       n[3].f = y;
    }
 
-   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 2;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
 
@@ -4928,7 +4928,7 @@ save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
       n[4].f = z;
    }
 
-   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 3;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
 
@@ -4952,7 +4952,7 @@ save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
       n[5].f = w;
    }
 
-   ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 4;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
 
index 36267c336f6788b30ec1e09819766e5df1ed0306..a90ce95a639841de1a5c4682f6217e2b9aa4c2a9 100644 (file)
@@ -953,7 +953,7 @@ parse_generic_attrib_num(GLcontext *ctx, const GLubyte ** inst,
 {
    GLint i = parse_integer(inst, Program);
 
-   if ((i < 0) || (i >= MAX_VERTEX_PROGRAM_ATTRIBS))
+   if ((i < 0) || (i >= MAX_VERTEX_GENERIC_ATTRIBS))
    {
       program_error(ctx, Program->Position,
                     "Invalid generic vertex attribute index");
@@ -1510,10 +1510,10 @@ generic_attrib_check(struct var_cache *vc_head)
 {
    int a;
    struct var_cache *curr;
-   GLboolean explicitAttrib[MAX_VERTEX_PROGRAM_ATTRIBS],
-      genericAttrib[MAX_VERTEX_PROGRAM_ATTRIBS];
+   GLboolean explicitAttrib[MAX_VERTEX_GENERIC_ATTRIBS],
+      genericAttrib[MAX_VERTEX_GENERIC_ATTRIBS];
 
-   for (a=0; a<MAX_VERTEX_PROGRAM_ATTRIBS; a++) {
+   for (a=0; a<MAX_VERTEX_GENERIC_ATTRIBS; a++) {
       explicitAttrib[a] = GL_FALSE;
       genericAttrib[a] = GL_FALSE;
    }
@@ -1524,11 +1524,11 @@ generic_attrib_check(struct var_cache *vc_head)
          if (curr->attrib_is_generic) {
             GLuint attr = (curr->attrib_binding == 0)
                ? 0 : (curr->attrib_binding - VERT_ATTRIB_GENERIC0);
-            assert(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
+            assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
             genericAttrib[attr] = GL_TRUE;
          }
          else {
-            assert(curr->attrib_binding < MAX_VERTEX_PROGRAM_ATTRIBS);
+            assert(curr->attrib_binding < MAX_VERTEX_GENERIC_ATTRIBS);
             explicitAttrib[ curr->attrib_binding ] = GL_TRUE;
          }
       }
@@ -1536,7 +1536,7 @@ generic_attrib_check(struct var_cache *vc_head)
       curr = curr->next;
    }
 
-   for (a=0; a<MAX_VERTEX_PROGRAM_ATTRIBS; a++) {
+   for (a=0; a<MAX_VERTEX_GENERIC_ATTRIBS; a++) {
       if ((explicitAttrib[a]) && (genericAttrib[a]))
          return 1;
    }
index 6f5a954c1652ccf3389d9ae2fc2954eb057c0ba6..21c5cfbf99cb54be6c48fd0e876ec4468a4f09f9 100644 (file)
@@ -310,7 +310,7 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
-   if (index >= MAX_VERTEX_PROGRAM_ATTRIBS) {
+   if (index >= MAX_VERTEX_GENERIC_ATTRIBS) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribfvARB(index)");
       return;
    }
index 1795f62c3233a1e2fc4bcc06973f716c31e5463a..c35eaf1538e637d66c965644d5e69003d12f5ccb 100644 (file)
@@ -207,7 +207,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine)
 {
    /* Input registers get initialized from the current vertex attribs */
    MEMCPY(machine->VertAttribs, ctx->Current.Attrib,
-          MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat));
+          MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat));
 
    if (ctx->VertexProgram._Current->IsNVProgram) {
       GLuint i;