mesa: remove MAX_VERTEX_PROGRAM_ATTRIBS
Use MAX_VERTEX_GENERIC_ATTRIBS instead. No need for two #defines for the same quantity.
This commit is contained in:
@@ -168,7 +168,6 @@
|
|||||||
/** For GL_ARB_vertex_program */
|
/** For GL_ARB_vertex_program */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
#define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
|
#define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
|
||||||
#define MAX_VERTEX_PROGRAM_ATTRIBS 16
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/** For GL_ARB_fragment_program */
|
/** For GL_ARB_fragment_program */
|
||||||
|
@@ -4883,7 +4883,7 @@ save_Attr1fNV(GLenum attr, GLfloat x)
|
|||||||
n[2].f = x;
|
n[2].f = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
|
ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
|
||||||
ctx->ListState.ActiveAttribSize[attr] = 1;
|
ctx->ListState.ActiveAttribSize[attr] = 1;
|
||||||
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, 0, 0, 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;
|
n[3].f = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
|
ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
|
||||||
ctx->ListState.ActiveAttribSize[attr] = 2;
|
ctx->ListState.ActiveAttribSize[attr] = 2;
|
||||||
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, 0, 1);
|
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;
|
n[4].f = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
|
ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
|
||||||
ctx->ListState.ActiveAttribSize[attr] = 3;
|
ctx->ListState.ActiveAttribSize[attr] = 3;
|
||||||
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, 1);
|
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;
|
n[5].f = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
|
ASSERT(attr < MAX_VERTEX_GENERIC_ATTRIBS);
|
||||||
ctx->ListState.ActiveAttribSize[attr] = 4;
|
ctx->ListState.ActiveAttribSize[attr] = 4;
|
||||||
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
|
ASSIGN_4V(ctx->ListState.CurrentAttrib[attr], x, y, z, w);
|
||||||
|
|
||||||
|
@@ -953,7 +953,7 @@ parse_generic_attrib_num(GLcontext *ctx, const GLubyte ** inst,
|
|||||||
{
|
{
|
||||||
GLint i = parse_integer(inst, Program);
|
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,
|
program_error(ctx, Program->Position,
|
||||||
"Invalid generic vertex attribute index");
|
"Invalid generic vertex attribute index");
|
||||||
@@ -1510,10 +1510,10 @@ generic_attrib_check(struct var_cache *vc_head)
|
|||||||
{
|
{
|
||||||
int a;
|
int a;
|
||||||
struct var_cache *curr;
|
struct var_cache *curr;
|
||||||
GLboolean explicitAttrib[MAX_VERTEX_PROGRAM_ATTRIBS],
|
GLboolean explicitAttrib[MAX_VERTEX_GENERIC_ATTRIBS],
|
||||||
genericAttrib[MAX_VERTEX_PROGRAM_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;
|
explicitAttrib[a] = GL_FALSE;
|
||||||
genericAttrib[a] = GL_FALSE;
|
genericAttrib[a] = GL_FALSE;
|
||||||
}
|
}
|
||||||
@@ -1524,11 +1524,11 @@ generic_attrib_check(struct var_cache *vc_head)
|
|||||||
if (curr->attrib_is_generic) {
|
if (curr->attrib_is_generic) {
|
||||||
GLuint attr = (curr->attrib_binding == 0)
|
GLuint attr = (curr->attrib_binding == 0)
|
||||||
? 0 : (curr->attrib_binding - VERT_ATTRIB_GENERIC0);
|
? 0 : (curr->attrib_binding - VERT_ATTRIB_GENERIC0);
|
||||||
assert(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
|
assert(attr < MAX_VERTEX_GENERIC_ATTRIBS);
|
||||||
genericAttrib[attr] = GL_TRUE;
|
genericAttrib[attr] = GL_TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(curr->attrib_binding < MAX_VERTEX_PROGRAM_ATTRIBS);
|
assert(curr->attrib_binding < MAX_VERTEX_GENERIC_ATTRIBS);
|
||||||
explicitAttrib[ curr->attrib_binding ] = GL_TRUE;
|
explicitAttrib[ curr->attrib_binding ] = GL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1536,7 +1536,7 @@ generic_attrib_check(struct var_cache *vc_head)
|
|||||||
curr = curr->next;
|
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]))
|
if ((explicitAttrib[a]) && (genericAttrib[a]))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -310,7 +310,7 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
|
|||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END(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)");
|
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribfvARB(index)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -207,7 +207,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine)
|
|||||||
{
|
{
|
||||||
/* Input registers get initialized from the current vertex attribs */
|
/* Input registers get initialized from the current vertex attribs */
|
||||||
MEMCPY(machine->VertAttribs, ctx->Current.Attrib,
|
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) {
|
if (ctx->VertexProgram._Current->IsNVProgram) {
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
Reference in New Issue
Block a user