aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.h
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/blend.h
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/blend.h')
-rw-r--r--src/mesa/main/blend.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
index c95bc578961..6e56f2fd1ea 100644
--- a/src/mesa/main/blend.h
+++ b/src/mesa/main/blend.h
@@ -198,4 +198,14 @@ _mesa_flush_vertices_for_blend_adv(struct gl_context *ctx,
_mesa_flush_vertices_for_blend_state(ctx);
}
+static inline GLbitfield
+_mesa_replicate_colormask(GLbitfield mask0, unsigned num_buffers)
+{
+ GLbitfield mask = mask0;
+
+ for (unsigned i = 1; i < num_buffers; i++)
+ mask |= mask0 << (i * 4);
+ return mask;
+}
+
#endif