summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-03 13:20:04 -0700
committerBrian Paul <brianp@vmware.com>2010-02-03 15:48:42 -0700
commita32e7c487cbae1a8521fa2d244763e2ec596af91 (patch)
tree44bc90d7cc624f77819a80616ee8b7bbb5503059 /src
parentcd130b0319644267e573360f296c6ccd0e2a1436 (diff)
mesa: added tex unit assert, use Elements() macro
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/rastpos.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index 703b47ec74..be61dc265d 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -273,6 +273,7 @@ window_pos3f(GLfloat x, GLfloat y, GLfloat z)
{
GLuint texSet;
for (texSet = 0; texSet < ctx->Const.MaxTextureCoordUnits; texSet++) {
+ assert(texSet < Elements(ctx->Current.RasterTexCoords));
COPY_4FV( ctx->Current.RasterTexCoords[texSet],
ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texSet] );
}
@@ -562,7 +563,7 @@ void _mesa_init_rastpos( GLcontext * ctx )
ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 );
ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterIndex = 1.0;
- for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++)
+ for (i = 0; i < Elements(ctx->Current.RasterTexCoords); i++)
ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 );
ctx->Current.RasterPosValid = GL_TRUE;
}