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/drivers/dri/i915tex/intel_pixel_draw.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/i915tex/intel_pixel_draw.c') diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c index 46480da1b1..77c67c821e 100644 --- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c @@ -363,9 +363,12 @@ intelDrawPixels(GLcontext * ctx, if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); - if (ctx->FragmentProgram._Current == - ctx->FragmentProgram._TexEnvProgram) { - /* don't want the i915 texenv program to be applied to DrawPixels */ + if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) { + /* + * We don't want the i915 texenv program to be applied to DrawPixels. + * This is really just a performance optimization (mesa will other- + * wise happily run the fragment program on each pixel in the image). + */ struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current; ctx->FragmentProgram._Current = NULL; _swrast_DrawPixels( ctx, x, y, width, height, format, type, -- cgit v1.2.3