summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-04-14 02:20:18 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-04-14 02:20:18 +0000
commitee4e75bd6f768b7210436feeb32b4545ed62e025 (patch)
tree2684654e69d43aa244fc6082717523da202aa43e /src/mesa/swrast
parent1d886a81add08536f18d2453ae38fcac79f0b806 (diff)
Replace ctx->Const.MaxTextureUnits w/ ctx->Const.MaxTexture[Coord/Image]Units
in various places. Note that ctx->Texture.CurrentUnit needs to be tested against Coord/Image limits when referenced, not just in glActiveTexture().
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_context.c11
-rw-r--r--src/mesa/swrast/s_span.c3
2 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index ea283a1943..c544e6c166 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -487,7 +487,7 @@ _swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state )
swrast->BlendFunc = _swrast_validate_blend_func;
if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC)
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureImageUnits ; i++)
swrast->TextureSample[i] = NULL;
}
@@ -688,10 +688,7 @@ _swrast_CreateContext( GLcontext *ctx )
swrast->PointSpan.facing = 0;
swrast->PointSpan.array = swrast->SpanArrays;
- assert(ctx->Const.MaxTextureUnits > 0);
- assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_UNITS);
-
- swrast->TexelBuffer = (GLchan *) MALLOC(ctx->Const.MaxTextureUnits *
+ swrast->TexelBuffer = (GLchan *) MALLOC(ctx->Const.MaxTextureImageUnits *
MAX_WIDTH * 4 * sizeof(GLchan));
if (!swrast->TexelBuffer) {
FREE(swrast->SpanArrays);
@@ -786,7 +783,7 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
_mesa_debug(ctx, "win %f %f %f %f\n",
v->win[0], v->win[1], v->win[2], v->win[3]);
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
if (ctx->Texture.Unit[i]._ReallyEnabled)
_mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i,
v->texcoord[i][0], v->texcoord[i][1],
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 11457723b0..35735a411f 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -127,7 +127,7 @@ void
_swrast_span_default_texcoords( GLcontext *ctx, struct sw_span *span )
{
GLuint i;
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
const GLfloat *tc = ctx->Current.RasterTexCoords[i];
if (ctx->FragmentProgram._Active || ctx->ATIFragmentShader._Enabled) {
COPY_4V(span->tex[i], tc);
@@ -401,6 +401,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
/* multitexture */
GLuint u;
span->arrayMask |= SPAN_TEXTURE;
+ /* XXX CoordUnits vs. ImageUnits */
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture._EnabledCoordUnits & (1 << u)) {
const struct gl_texture_object *obj =ctx->Texture.Unit[u]._Current;