summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_clear.c
diff options
context:
space:
mode:
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);
}
}