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);
-
- /* Secondary color */
- 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);
- ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0);
- }
+ COPY_4V(span->attrStart[FRAG_ATTRIB_COL], ctx->Current.RasterColor);
+ ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL], 0.0, 0.0, 0.0, 0.0);
+ ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL], 0.0, 0.0, 0.0, 0.0);
/* fog */
{
break;
#endif
case GL_FLOAT:
- interpolate_active_attribs(ctx, span, FRAG_BIT_COL0);
+ interpolate_active_attribs(ctx, span, FRAG_BIT_COL);
break;
default:
_mesa_problem(ctx, "bad datatype 0x%x in interpolate_int_colors",
/**
- * Populate the FRAG_ATTRIB_COL0 array.
+ * Populate the FRAG_ATTRIB_COL array.
*/
static inline void
interpolate_float_colors(SWspan *span)
{
- GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
+ GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL];
const GLuint n = span->end;
GLuint i;
}
}
- span->arrayAttribs |= FRAG_BIT_COL0;
+ span->arrayAttribs |= FRAG_BIT_COL;
span->array->ChanType = GL_FLOAT;
}
}
-/**
- * Add specular colors to primary colors.
- * Only called during fixed-function operation.
- * Result is float color array (FRAG_ATTRIB_COL0).
- */
-static inline void
-add_specular(struct gl_context *ctx, SWspan *span)
-{
- const SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLubyte *mask = span->array->mask;
- GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
- GLfloat (*col1)[4] = span->array->attribs[FRAG_ATTRIB_COL1];
- GLuint i;
-
- ASSERT(!_swrast_use_fragment_program(ctx));
- ASSERT(span->arrayMask & SPAN_RGBA);
- ASSERT(swrast->_ActiveAttribMask & FRAG_BIT_COL1);
- (void) swrast; /* silence warning */
-
- if (span->array->ChanType == GL_FLOAT) {
- if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) {
- interpolate_active_attribs(ctx, span, FRAG_BIT_COL0);
- }
- }
- else {
- /* need float colors */
- if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) {
- interpolate_float_colors(span);
- }
- }
-
- if ((span->arrayAttribs & FRAG_BIT_COL1) == 0) {
- /* XXX could avoid this and interpolate COL1 in the loop below */
- interpolate_active_attribs(ctx, span, FRAG_BIT_COL1);
- }
-
- ASSERT(span->arrayAttribs & FRAG_BIT_COL0);
- ASSERT(span->arrayAttribs & FRAG_BIT_COL1);
-
- for (i = 0; i < span->end; i++) {
- if (mask[i]) {
- col0[i][0] += col1[i][0];
- col0[i][1] += col1[i][1];
- col0[i][2] += col1[i][2];
- }
- }
-
- span->array->ChanType = GL_FLOAT;
-}
-
-
/**
* Apply antialiasing coverage value to alpha values.
*/
}
}
else {
- GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
+ GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
for (i = 0; i < span->end; i++) {
rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i];
/* clamp later */
static inline void
clamp_colors(SWspan *span)
{
- GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
+ GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL];
GLuint i;
ASSERT(span->array->ChanType == GL_FLOAT);
for (i = 0; i < span->end; i++) {
GLvoid *src, *dst;
if (output > 0 || span->array->ChanType == GL_FLOAT) {
- src = span->array->attribs[FRAG_ATTRIB_COL0 + output];
+ src = span->array->attribs[FRAG_ATTRIB_COL + output];
span->array->ChanType = GL_FLOAT;
}
else if (span->array->ChanType == GL_UNSIGNED_BYTE) {
dst = span->array->rgba16;
}
else {
- dst = span->array->attribs[FRAG_ATTRIB_COL0];
+ dst = span->array->attribs[FRAG_ATTRIB_COL];
}
_mesa_convert_colors(span->array->ChanType, src,
ASSERT(span->arrayMask & SPAN_RGBA);
- if (span->primitive == GL_BITMAP || !swrast->SpecularVertexAdd) {
- /* Add primary and specular (diffuse + specular) colors */
- if (ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
- add_specular(ctx, span);
- }
- }
-
/* Fog */
if (swrast->_FogEnabled) {
_swrast_fog_rgba_span(ctx, span);
span->array->rgba = span->array->rgba8;
}
else {
- span->array->rgba = (void *)span->array->attribs[FRAG_ATTRIB_COL0];
+ span->array->rgba = (void *)span->array->attribs[FRAG_ATTRIB_COL];
}
}