From fd5511d27fc44096117c47ab503fb5b47f993061 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Dec 2009 16:17:14 -0700 Subject: mesa: implement per-buffer color masking This is part of the GL_EXT_draw_buffers2 extension and part of GL 3.0. The ctx->Color.ColorMask field is now a 2-D array. Until drivers are modified to support per-buffer color masking, they can just look at the 0th color mask. The new _mesa_ColorMaskIndexed() function will be called by glColorMaskIndexedEXT() or glColorMaski(). --- src/mesa/swrast/s_accum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/swrast/s_accum.c') diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index c6c7dbf5cf..2d8c361e5d 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -528,7 +528,7 @@ accum_return(GLcontext *ctx, GLfloat value, for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) { struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buffer]; if (masking) { - _swrast_mask_rgba_span(ctx, rb, &span); + _swrast_mask_rgba_span(ctx, rb, &span, buffer); } rb->PutRow(ctx, rb, width, xpos, ypos + i, span.array->rgba, NULL); } -- cgit v1.2.3 From b841c2756e6d697d5b2884317c0daa3f176195a6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 7 Jan 2010 09:43:08 -0700 Subject: swrast: fix color masking for glAccum(GL_RETURN) Should fix fdo bug 25837. --- src/mesa/swrast/s_accum.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/swrast/s_accum.c') diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 2d8c361e5d..0e0876efcb 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -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); } -- cgit v1.2.3