From: Ian Romanick Date: Thu, 25 Feb 2010 00:02:38 +0000 (-0800) Subject: swrast: Remove remaining color-index state tracking infrastructure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b7911d37dc1518b9047b02acdc6f8476abad70f;p=mesa.git swrast: Remove remaining color-index state tracking infrastructure Signed-off-by: Ian Romanick --- diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 0d4680db9f7..751966348b1 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -63,24 +63,17 @@ _swrast_update_rasterflags( GLcontext *ctx ) if (swrast->_FogEnabled) rasterMask |= FOG_BIT; if (ctx->Scissor.Enabled) rasterMask |= CLIP_BIT; if (ctx->Stencil._Enabled) rasterMask |= STENCIL_BIT; - if (ctx->Visual.rgbMode) { - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - if (!ctx->Color.ColorMask[i][0] || - !ctx->Color.ColorMask[i][1] || - !ctx->Color.ColorMask[i][2] || - !ctx->Color.ColorMask[i][3]) { - rasterMask |= MASKING_BIT; - break; - } + for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { + if (!ctx->Color.ColorMask[i][0] || + !ctx->Color.ColorMask[i][1] || + !ctx->Color.ColorMask[i][2] || + !ctx->Color.ColorMask[i][3]) { + rasterMask |= MASKING_BIT; + break; } - if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT; - if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT; - } - else { - if (ctx->Color.IndexMask != 0xffffffff) rasterMask |= MASKING_BIT; - if (ctx->Color.IndexLogicOpEnabled) rasterMask |= LOGIC_OP_BIT; } - + if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT; + if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT; if ( ctx->Viewport.X < 0 || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width || ctx->Viewport.Y < 0 @@ -100,19 +93,14 @@ _swrast_update_rasterflags( GLcontext *ctx ) /* more than one color buffer designated for writing (or zero buffers) */ rasterMask |= MULTI_DRAW_BIT; } - else if (!ctx->Visual.rgbMode && ctx->Color.IndexMask==0) { - rasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */ - } - if (ctx->Visual.rgbMode) { - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - if (ctx->Color.ColorMask[i][0] + - ctx->Color.ColorMask[i][1] + - ctx->Color.ColorMask[i][2] + - ctx->Color.ColorMask[i][3] == 0) { - rasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */ - break; - } + for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { + if (ctx->Color.ColorMask[i][0] + + ctx->Color.ColorMask[i][1] + + ctx->Color.ColorMask[i][2] + + ctx->Color.ColorMask[i][3] == 0) { + rasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */ + break; } } @@ -892,12 +880,7 @@ _swrast_flush( GLcontext *ctx ) SWcontext *swrast = SWRAST_CONTEXT(ctx); /* flush any pending fragments from rendering points */ if (swrast->PointSpan.end > 0) { - if (ctx->Visual.rgbMode) { - _swrast_write_rgba_span(ctx, &(swrast->PointSpan)); - } - else { - _swrast_write_index_span(ctx, &(swrast->PointSpan)); - } + _swrast_write_rgba_span(ctx, &(swrast->PointSpan)); swrast->PointSpan.end = 0; } } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index dada3643606..dd67f633210 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -80,41 +80,34 @@ _swrast_span_default_attribs(GLcontext *ctx, SWspan *span) span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; /* primary color, or color index */ - if (ctx->Visual.rgbMode) { - GLchan r, g, b, a; - UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]); + GLchan r, g, b, a; + UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]); #if CHAN_TYPE == GL_FLOAT - span->red = r; - span->green = g; - span->blue = b; - span->alpha = a; + span->red = r; + span->green = g; + span->blue = b; + span->alpha = a; #else - span->red = IntToFixed(r); - span->green = IntToFixed(g); - span->blue = IntToFixed(b); - span->alpha = IntToFixed(a); + span->red = IntToFixed(r); + span->green = IntToFixed(g); + span->blue = IntToFixed(b); + span->alpha = IntToFixed(a); #endif - span->redStep = 0; - span->greenStep = 0; - span->blueStep = 0; - span->alphaStep = 0; - span->interpMask |= SPAN_RGBA; + span->redStep = 0; + span->greenStep = 0; + span->blueStep = 0; + span->alphaStep = 0; + span->interpMask |= SPAN_RGBA; - COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); - ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - } - else { - span->index = FloatToFixed(ctx->Current.RasterIndex); - span->indexStep = 0; - span->interpMask |= SPAN_INDEX; - } + COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); + ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); + ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); /* Secondary color */ - if (ctx->Visual.rgbMode && (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled)) + if (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled) { COPY_4V(span->attrStart[FRAG_ATTRIB_COL1], ctx->Current.RasterSecondaryColor); ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0);