From b7f5e92f1749ce4601a758f66ddc64959f11742b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 12 Apr 2002 15:39:58 +0000 Subject: Klaus Niederkrueger's latest changes: use INIT_SPAN() to init span primitive type, width, interp mask and array mask. --- src/mesa/swrast/s_pixeltex.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/mesa/swrast/s_pixeltex.c') diff --git a/src/mesa/swrast/s_pixeltex.c b/src/mesa/swrast/s_pixeltex.c index fab67da69f..c2b597a9af 100644 --- a/src/mesa/swrast/s_pixeltex.c +++ b/src/mesa/swrast/s_pixeltex.c @@ -1,4 +1,4 @@ -/* $Id: s_pixeltex.c,v 1.7 2002/04/04 16:53:59 brianp Exp $ */ +/* $Id: s_pixeltex.c,v 1.8 2002/04/12 15:39:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -97,6 +97,9 @@ _swrast_pixel_texture(GLcontext *ctx, struct sw_span *span) GLchan primary_rgba[MAX_WIDTH][4]; GLuint unit; + ASSERT(!(span->arrayMask & SPAN_TEXTURE)); + span->arrayMask |= SPAN_TEXTURE; + MEMCPY(primary_rgba, span->color.rgba, 4 * span->end * sizeof(GLchan)); for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { @@ -104,24 +107,25 @@ _swrast_pixel_texture(GLcontext *ctx, struct sw_span *span) pixeltexgen(ctx, span->end, (const GLchan (*)[4]) span->color.rgba, span->texcoords[unit]); - _swrast_texture_fragments(ctx, unit, span->end, - span->texcoords[unit], - NULL, /* lambda */ - (CONST GLchan (*)[4]) primary_rgba, - span->color.rgba); + _swrast_texture_fragments(ctx, unit, span, + (CONST GLchan (*)[4]) primary_rgba); } } + /* this is a work-around to be fixed by initializing again span */ + span->arrayMask &= ~SPAN_TEXTURE; } else { /* single texture, unit 0 */ ASSERT(ctx->Texture._ReallyEnabled & TEXTURE0_ANY); + ASSERT(!(span->arrayMask & SPAN_TEXTURE)); + span->arrayMask |= SPAN_TEXTURE; + pixeltexgen(ctx, span->end, (const GLchan (*)[4]) span->color.rgba, span->texcoords[0]); - _swrast_texture_fragments(ctx, 0, span->end, - span->texcoords[0], - NULL, /* lambda */ - (CONST GLchan (*)[4]) span->color.rgba, - (GLchan (*)[4]) span->color.rgba); + _swrast_texture_fragments(ctx, 0, span, + (CONST GLchan (*)[4]) span->color.rgba); + /* this is a work-around to be fixed */ + span->arrayMask &= ~SPAN_TEXTURE; } } -- cgit v1.2.3