swrast: fix color masking for glAccum(GL_RETURN)
authorBrian Paul <brianp@vmware.com>
Thu, 7 Jan 2010 16:43:08 +0000 (09:43 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 7 Jan 2010 16:43:11 +0000 (09:43 -0700)
Should fix fdo bug 25837.

src/mesa/swrast/s_accum.c

index 2d8c361e5d77f5732a55fda72a83b402cfb8e659..0e0876efcba78afa8d4225d950b92ddfeb697b7d 100644 (file)
@@ -436,10 +436,6 @@ accum_return(GLcontext *ctx, GLfloat value,
    struct gl_renderbuffer *accumRb = fb->Attachment[BUFFER_ACCUM].Renderbuffer;
    const GLboolean directAccess
       = (accumRb->GetPointer(ctx, accumRb, 0, 0) != NULL);
-   const GLboolean masking = (!ctx->Color.ColorMask[RCOMP] ||
-                              !ctx->Color.ColorMask[GCOMP] ||
-                              !ctx->Color.ColorMask[BCOMP] ||
-                              !ctx->Color.ColorMask[ACOMP]);
 
    static GLchan multTable[32768];
    static GLfloat prevMult = 0.0;
@@ -527,6 +523,10 @@ accum_return(GLcontext *ctx, GLfloat value,
          /* store colors */
          for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) {
             struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buffer];
+            const GLboolean masking = (!ctx->Color.ColorMask[buffer][RCOMP] ||
+                                       !ctx->Color.ColorMask[buffer][GCOMP] ||
+                                       !ctx->Color.ColorMask[buffer][BCOMP] ||
+                                       !ctx->Color.ColorMask[buffer][ACOMP]);
             if (masking) {
                _swrast_mask_rgba_span(ctx, rb, &span, buffer);
             }