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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user