summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/accum.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/main/accum.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/main/accum.c')
-rw-r--r--src/mesa/main/accum.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 2b15b6ee0d3..5fbee8fbdbd 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -298,10 +298,10 @@ accum_return(struct gl_context *ctx, GLfloat value,
/* Loop over destination buffers */
for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) {
struct gl_renderbuffer *colorRb = 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]);
+ const GLboolean masking = (!GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 0) ||
+ !GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 1) ||
+ !GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 2) ||
+ !GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 3));
GLbitfield mappingFlags = GL_MAP_WRITE_BIT;
if (masking)
@@ -340,19 +340,19 @@ accum_return(struct gl_context *ctx, GLfloat value,
_mesa_unpack_rgba_row(colorRb->Format, width, colorMap, dest);
/* use the dest colors where mask[channel] = 0 */
- if (ctx->Color.ColorMask[buffer][RCOMP] == 0) {
+ if (!GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 0)) {
for (i = 0; i < width; i++)
rgba[i][RCOMP] = dest[i][RCOMP];
}
- if (ctx->Color.ColorMask[buffer][GCOMP] == 0) {
+ if (!GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 1)) {
for (i = 0; i < width; i++)
rgba[i][GCOMP] = dest[i][GCOMP];
}
- if (ctx->Color.ColorMask[buffer][BCOMP] == 0) {
+ if (!GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 2)) {
for (i = 0; i < width; i++)
rgba[i][BCOMP] = dest[i][BCOMP];
}
- if (ctx->Color.ColorMask[buffer][ACOMP] == 0) {
+ if (!GET_COLORMASK_BIT(ctx->Color.ColorMask, buffer, 3)) {
for (i = 0; i < width; i++)
rgba[i][ACOMP] = dest[i][ACOMP];
}