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
/* 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;
}
}
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;
}
}
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);