INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY);
_swrast_span_default_color(ctx, &span);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- _swrast_span_default_secondary_color(ctx, &span);
+ _swrast_span_default_secondary_color(ctx, &span);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
_swrast_span_default_fog(ctx, &span);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- _swrast_span_default_secondary_color(ctx, &span);
+ _swrast_span_default_secondary_color(ctx, &span);
/* allocate space for GLfloat image */
tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
_swrast_span_default_fog(ctx, &span);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- _swrast_span_default_secondary_color(ctx, &span);
+ _swrast_span_default_secondary_color(ctx, &span);
if (overlapping) {
tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4);
}
_swrast_span_default_color(ctx, &span);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- _swrast_span_default_secondary_color(ctx, &span);
+ _swrast_span_default_secondary_color(ctx, &span);
if (swrast->_FogEnabled)
_swrast_span_default_fog(ctx, &span);
}
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- _swrast_span_default_secondary_color(ctx, &span);
+ _swrast_span_default_secondary_color(ctx, &span);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
_swrast_span_default_color(ctx, &span);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- _swrast_span_default_secondary_color(ctx, &span);
+ _swrast_span_default_secondary_color(ctx, &span);
if (swrast->_FogEnabled)
_swrast_span_default_fog(ctx, &span);
if (ctx->Texture._EnabledCoordUnits)
return;
INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
- if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- _swrast_span_default_secondary_color(ctx, &span);
+ _swrast_span_default_secondary_color(ctx, &span);
if (ctx->Depth.Test)
_swrast_span_default_z(ctx, &span);
if (swrast->_FogEnabled)
}
+/**
+ * Set the span's secondary color info to the current raster position's
+ * secondary color, when needed (lighting enabled or colorsum enabled).
+ */
void
_swrast_span_default_secondary_color(GLcontext *ctx, SWspan *span)
{
- if (ctx->Visual.rgbMode) {
+ if (ctx->Visual.rgbMode && (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled))
+ {
GLchan r, g, b, a;
UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterSecondaryColor[0]);
UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterSecondaryColor[1]);