mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBS
authorBrian Paul <brianp@vmware.com>
Fri, 22 May 2009 13:26:08 +0000 (07:26 -0600)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 22 Jun 2009 22:15:19 +0000 (15:15 -0700)
Be clearer that this is the number of generic vertex program/shader
attributes, not counting the legacy attributes (pos, normal, color, etc).
(cherry picked from commit 4a95185c9f30c2de7a03bb1a0653f51b53b1111d)

src/mesa/main/api_noop.c
src/mesa/main/config.h
src/mesa/main/dlist.c
src/mesa/main/enums.c
src/mesa/shader/slang/slang_link.c
src/mesa/vbo/vbo_attrib_tmp.h
src/mesa/vbo/vbo_exec_array.c

index a1cc3a2a4b8a5483ef439280b931e87dc0be0b94..66f9c4e6bdb0d65573fc8b98d69823dd411fd6dd 100644 (file)
@@ -477,7 +477,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat
 static void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, 0, 0, 1);
    }
    else
@@ -487,7 +487,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x )
 static void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloat *v )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], 0, 0, 1);
    }
    else
@@ -497,7 +497,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloa
 static void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, 0, 1);
    }
    else
@@ -507,7 +507,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GL
 static void GLAPIENTRY _mesa_noop_VertexAttrib2fvARB( GLuint index, const GLfloat *v )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], 0, 1);
    }
    else
@@ -518,7 +518,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib3fARB( GLuint index, GLfloat x,
                                   GLfloat y, GLfloat z )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, 1);
    }
    else
@@ -528,7 +528,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib3fARB( GLuint index, GLfloat x,
 static void GLAPIENTRY _mesa_noop_VertexAttrib3fvARB( GLuint index, const GLfloat *v )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], 1);
    }
    else
@@ -539,7 +539,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib4fARB( GLuint index, GLfloat x,
                                   GLfloat y, GLfloat z, GLfloat w )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, w);
    }
    else
@@ -549,7 +549,7 @@ static void GLAPIENTRY _mesa_noop_VertexAttrib4fARB( GLuint index, GLfloat x,
 static void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_ATTRIBS) {
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS) {
       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], v[3]);
    }
    else
index bd66a4c2317b94cc3ba07a35f7aa870d780401ab..aecea689af855f92963dfbeef2fd3dea831af638 100644 (file)
 
 /** For GL_ARB_vertex_shader */
 /*@{*/
-#define MAX_VERTEX_ATTRIBS 16
+#define MAX_VERTEX_GENERIC_ATTRIBS 16
 #define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
 #define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
 /*@}*/
index 537ff5881f36f1f59671a3ef951954481297e72b..0bd7c3d9a1e99b692e628bce098ca55d4dc1012b 100644 (file)
@@ -4974,7 +4974,7 @@ save_Attr1fARB(GLenum attr, GLfloat x)
       n[2].f = x;
    }
 
-   ASSERT(attr < MAX_VERTEX_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 1;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 1);
 
@@ -4996,7 +4996,7 @@ save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y)
       n[3].f = y;
    }
 
-   ASSERT(attr < MAX_VERTEX_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 2;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
 
@@ -5019,7 +5019,7 @@ save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z)
       n[4].f = z;
    }
 
-   ASSERT(attr < MAX_VERTEX_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 3;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
 
@@ -5043,7 +5043,7 @@ save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
       n[5].f = w;
    }
 
-   ASSERT(attr < MAX_VERTEX_ATTRIBS);
+   ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
    ctx->ListState.ActiveAttribSize[attr] = 4;
    ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
 
@@ -5582,7 +5582,7 @@ save_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
 static void GLAPIENTRY
 save_VertexAttrib1fARB(GLuint index, GLfloat x)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr1fARB(index, x);
    else
       index_error();
@@ -5591,7 +5591,7 @@ save_VertexAttrib1fARB(GLuint index, GLfloat x)
 static void GLAPIENTRY
 save_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr1fARB(index, v[0]);
    else
       index_error();
@@ -5600,7 +5600,7 @@ save_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
 static void GLAPIENTRY
 save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr2fARB(index, x, y);
    else
       index_error();
@@ -5609,7 +5609,7 @@ save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
 static void GLAPIENTRY
 save_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr2fARB(index, v[0], v[1]);
    else
       index_error();
@@ -5618,7 +5618,7 @@ save_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
 static void GLAPIENTRY
 save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr3fARB(index, x, y, z);
    else
       index_error();
@@ -5627,7 +5627,7 @@ save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
 static void GLAPIENTRY
 save_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr3fARB(index, v[0], v[1], v[2]);
    else
       index_error();
@@ -5637,7 +5637,7 @@ static void GLAPIENTRY
 save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
                        GLfloat w)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr4fARB(index, x, y, z, w);
    else
       index_error();
@@ -5646,7 +5646,7 @@ save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z,
 static void GLAPIENTRY
 save_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
 {
-   if (index < MAX_VERTEX_ATTRIBS)
+   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       save_Attr4fARB(index, v[0], v[1], v[2], v[3]);
    else
       index_error();
index c077bc0a89a967857c627118fce77ac1403e0a0c..cf893fdac5112ffd97fe2cc2304ef2192e028956 100644 (file)
@@ -948,8 +948,8 @@ LONGSTRING static const char enum_string_table[] =
    "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV\0"
    "GL_MAX_VARYING_FLOATS\0"
    "GL_MAX_VARYING_FLOATS_ARB\0"
-   "GL_MAX_VERTEX_ATTRIBS\0"
-   "GL_MAX_VERTEX_ATTRIBS_ARB\0"
+   "GL_MAX_VERTEX_GENERIC_ATTRIBS\0"
+   "GL_MAX_VERTEX_GENERIC_ATTRIBS_ARB\0"
    "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS\0"
    "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB\0"
    "GL_MAX_VERTEX_UNIFORM_COMPONENTS\0"
@@ -2772,8 +2772,8 @@ static const enum_elt all_enums[1820] =
    { 19417, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
    { 19452, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
    { 19474, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
-   { 19500, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
-   { 19522, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+   { 19500, 0x00008869 }, /* GL_MAX_VERTEX_GENERIC_ATTRIBS */
+   { 19522, 0x00008869 }, /* GL_MAX_VERTEX_GENERIC_ATTRIBS_ARB */
    { 19548, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
    { 19582, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
    { 19620, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
@@ -4733,7 +4733,7 @@ static const unsigned reduced_enums[1319] =
        317, /* GL_CURRENT_QUERY */
       1259, /* GL_QUERY_RESULT */
       1261, /* GL_QUERY_RESULT_AVAILABLE */
-       912, /* GL_MAX_VERTEX_ATTRIBS */
+       912, /* GL_MAX_VERTEX_GENERIC_ATTRIBS */
       1778, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
        368, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
        367, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
index 1fdf4db054c3a722d521f0e041621bed571f7fb2..8c9fe1ea1f9641e2d1ee449d3728122771211d97 100644 (file)
@@ -319,7 +319,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
                           const struct gl_program *origProg,
                           struct gl_program *linkedProg)
 {
-   GLint attribMap[MAX_VERTEX_ATTRIBS];
+   GLint attribMap[MAX_VERTEX_GENERIC_ATTRIBS];
    GLuint i, j;
    GLbitfield usedAttributes; /* generics only, not legacy attributes */
 
@@ -355,7 +355,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
    }
 
    /* initialize the generic attribute map entries to -1 */
-   for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) {
+   for (i = 0; i < MAX_VERTEX_GENERIC_ATTRIBS; i++) {
       attribMap[i] = -1;
    }
 
@@ -396,11 +396,11 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
                    * Start at 1 since generic attribute 0 always aliases
                    * glVertex/position.
                    */
-                  for (attr = 0; attr < MAX_VERTEX_ATTRIBS; attr++) {
+                  for (attr = 0; attr < MAX_VERTEX_GENERIC_ATTRIBS; attr++) {
                      if (((1 << attr) & usedAttributes) == 0)
                         break;
                   }
-                  if (attr == MAX_VERTEX_ATTRIBS) {
+                  if (attr == MAX_VERTEX_GENERIC_ATTRIBS) {
                      link_error(shProg, "Too many vertex attributes");
                      return GL_FALSE;
                   }
index ff11c7d59a775b589a85127a396b417e9607a32c..7a889b8e2f856d65881946e0cf398993b3bf74ad 100644 (file)
@@ -265,7 +265,7 @@ static void GLAPIENTRY TAG(VertexAttrib1fARB)( GLuint index, GLfloat x )
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR1F(0, x);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR1F(VBO_ATTRIB_GENERIC0 + index, x);
    else
       ERROR();
@@ -277,7 +277,7 @@ static void GLAPIENTRY TAG(VertexAttrib1fvARB)( GLuint index,
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR1FV(0, v);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR1FV(VBO_ATTRIB_GENERIC0 + index, v);
    else
       ERROR();
@@ -289,7 +289,7 @@ static void GLAPIENTRY TAG(VertexAttrib2fARB)( GLuint index, GLfloat x,
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR2F(0, x, y);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR2F(VBO_ATTRIB_GENERIC0 + index, x, y);
    else
       ERROR();
@@ -301,7 +301,7 @@ static void GLAPIENTRY TAG(VertexAttrib2fvARB)( GLuint index,
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR2FV(0, v);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR2FV(VBO_ATTRIB_GENERIC0 + index, v);
    else
       ERROR();
@@ -313,7 +313,7 @@ static void GLAPIENTRY TAG(VertexAttrib3fARB)( GLuint index, GLfloat x,
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR3F(0, x, y, z);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR3F(VBO_ATTRIB_GENERIC0 + index, x, y, z);
    else
       ERROR();
@@ -325,7 +325,7 @@ static void GLAPIENTRY TAG(VertexAttrib3fvARB)( GLuint index,
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR3FV(0, v);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR3FV(VBO_ATTRIB_GENERIC0 + index, v);
    else
       ERROR();
@@ -338,7 +338,7 @@ static void GLAPIENTRY TAG(VertexAttrib4fARB)( GLuint index, GLfloat x,
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR4F(0, x, y, z, w);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR4F(VBO_ATTRIB_GENERIC0 + index, x, y, z, w);
    else
       ERROR();
@@ -350,7 +350,7 @@ static void GLAPIENTRY TAG(VertexAttrib4fvARB)( GLuint index,
    GET_CURRENT_CONTEXT( ctx );
    if (index == 0) 
       ATTR4FV(0, v);
-   else if (index < MAX_VERTEX_ATTRIBS)
+   else if (index < MAX_VERTEX_GENERIC_ATTRIBS)
       ATTR4FV(VBO_ATTRIB_GENERIC0 + index, v);
    else
       ERROR();
index 65fe197a4d7d79f1f1fe7bd14b4e890f6c6ad57b..de66cdd92fd3d53cfa9bbfec4cdc7f454f9ba473 100644 (file)
@@ -118,7 +118,7 @@ static void bind_array_obj( GLcontext *ctx )
    for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++)
       exec->array.legacy_array[VERT_ATTRIB_TEX0 + i] = &arrayObj->TexCoord[i];
 
-   for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) {
+   for (i = 0; i < MAX_VERTEX_GENERIC_ATTRIBS; i++) {
       assert(i < Elements(arrayObj->VertexAttrib));
       assert(i < Elements(exec->array.generic_array));
       exec->array.generic_array[i] = &arrayObj->VertexAttrib[i];
@@ -219,7 +219,7 @@ static void recalculate_input_bindings( GLcontext *ctx )
          }
       }
 
-      for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) {
+      for (i = 0; i < MAX_VERTEX_GENERIC_ATTRIBS; i++) {
         if (exec->array.generic_array[i]->Enabled)
            inputs[VERT_ATTRIB_GENERIC0 + i] = exec->array.generic_array[i];
         else {