From 171dcdfa27dda30916a7f9bfed89577feee5d350 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 21 Jun 2007 09:15:32 -0600 Subject: Another round of fixing attribute interpolation for glDraw/CopyPixels. Need to turn off FRAG_BIT_COL0 in swrast->_ActiveAttribMask when doing glRead/CopyPixels to prevent the user's colors from getting overwritten when a fragment program is active. This was happening in the DRI drivers when MaintainTexEnv program was used (the texenv fragment program was enabled when _swrast_DrawPixels was called). This still isn't an ideal solution, but fixes things for now. --- src/mesa/swrast/s_span.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa/swrast/s_span.c') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 3aaa339..431629e 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -171,6 +171,11 @@ interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); + /* for glDraw/CopyPixels() we may have turned off some bits in + * the _ActiveAttribMask - be sure to obey that mask now. + */ + attrMask &= swrast->_ActiveAttribMask; + ATTRIB_LOOP_BEGIN if (attrMask & (1 << attr)) { const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; @@ -1169,15 +1174,10 @@ shade_texture_span(GLcontext *ctx, SWspan *span) if (ctx->FragmentProgram._Current || ctx->ATIFragmentShader._Enabled) { /* programmable shading */ - if (span->primitive == GL_BITMAP) { - if (span->array->ChanType != GL_FLOAT) - convert_color_type(span, GL_FLOAT, 0); - interpolate_active_attribs(ctx, span, ~FRAG_ATTRIB_COL0); - } - else { - /* point, line, triangle */ - interpolate_active_attribs(ctx, span, ~0); + if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) { + convert_color_type(span, GL_FLOAT, 0); } + interpolate_active_attribs(ctx, span, ~0); span->array->ChanType = GL_FLOAT; if (!(span->arrayMask & SPAN_Z)) -- cgit v1.1