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().
This commit is contained in:
Brian Paul
2009-12-29 16:17:14 -07:00
parent 126b35bd3a
commit fd5511d27f
44 changed files with 351 additions and 231 deletions

View File

@@ -232,13 +232,13 @@ clear_with_quad(GLcontext *ctx,
blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
if (color) {
if (ctx->Color.ColorMask[0])
if (ctx->Color.ColorMask[0][0])
blend.colormask |= PIPE_MASK_R;
if (ctx->Color.ColorMask[1])
if (ctx->Color.ColorMask[0][1])
blend.colormask |= PIPE_MASK_G;
if (ctx->Color.ColorMask[2])
if (ctx->Color.ColorMask[0][2])
blend.colormask |= PIPE_MASK_B;
if (ctx->Color.ColorMask[3])
if (ctx->Color.ColorMask[0][3])
blend.colormask |= PIPE_MASK_A;
if (st->ctx->Color.DitherFlag)
blend.dither = 1;
@@ -300,10 +300,10 @@ check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
ctx->Scissor.Height < rb->Height))
return TRUE;
if (!ctx->Color.ColorMask[0] ||
!ctx->Color.ColorMask[1] ||
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3])
if (!ctx->Color.ColorMask[0][0] ||
!ctx->Color.ColorMask[0][1] ||
!ctx->Color.ColorMask[0][2] ||
!ctx->Color.ColorMask[0][3])
return TRUE;
return FALSE;