diff options
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_context.c | 11 | ||||
-rw-r--r-- | src/mesa/swrast/s_span.c | 3 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index ea283a19430..c544e6c166c 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 11457723b09..35735a411f9 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; |