summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_clear.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-01-31 03:03:25 +0100
committerMarek Olšák <[email protected]>2018-02-04 01:50:10 +0100
commitaf3685d14936844f79e6f372b4b258e29375f21b (patch)
tree84c3ab4b661bceaf4364be3e7c9501cb6b50537e /src/mesa/swrast/s_clear.c
parent83e60ce927142752c57163fcb8b30eca2370d014 (diff)
mesa: change ctx->Color.ColorMask into a 32-bit bitmask
4 bits per draw buffer, 8 draw buffers in total --> 32 bits. This is easier to work with. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_clear.c')
-rw-r--r--src/mesa/swrast/s_clear.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c
index c26b4be0d9e..ddafb67c98f 100644
--- a/src/mesa/swrast/s_clear.c
+++ b/src/mesa/swrast/s_clear.c
@@ -187,7 +187,13 @@ clear_color_buffers(struct gl_context *ctx)
if (rb == NULL)
continue;
- clear_rgba_buffer(ctx, rb, ctx->Color.ColorMask[buf]);
+ const GLubyte colormask[4] = {
+ GET_COLORMASK_BIT(ctx->Color.ColorMask, buf, 0) ? 0xff : 0,
+ GET_COLORMASK_BIT(ctx->Color.ColorMask, buf, 1) ? 0xff : 0,
+ GET_COLORMASK_BIT(ctx->Color.ColorMask, buf, 2) ? 0xff : 0,
+ GET_COLORMASK_BIT(ctx->Color.ColorMask, buf, 3) ? 0xff : 0,
+ };
+ clear_rgba_buffer(ctx, rb, colormask);
}
}