diff options
author | Marek Olšák <[email protected]> | 2018-01-31 03:03:25 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-02-04 01:50:10 +0100 |
commit | af3685d14936844f79e6f372b4b258e29375f21b (patch) | |
tree | 84c3ab4b661bceaf4364be3e7c9501cb6b50537e /src/mesa/drivers/dri/i915 | |
parent | 83e60ce927142752c57163fcb8b30eca2370d014 (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/drivers/dri/i915')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_clear.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_pixel.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_pixel_copy.c | 5 |
3 files changed, 3 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_clear.c b/src/mesa/drivers/dri/i915/intel_clear.c index f8df2e08d37..c9722cbe405 100644 --- a/src/mesa/drivers/dri/i915/intel_clear.c +++ b/src/mesa/drivers/dri/i915/intel_clear.c @@ -81,7 +81,6 @@ static void intelClear(struct gl_context *ctx, GLbitfield mask) { struct intel_context *intel = intel_context(ctx); - GLuint colorMask; GLbitfield tri_mask = 0; GLbitfield blit_mask = 0; GLbitfield swrast_mask = 0; @@ -89,8 +88,6 @@ intelClear(struct gl_context *ctx, GLbitfield mask) struct intel_renderbuffer *irb; int i; - memcpy(&colorMask, &ctx->Color.ColorMask[0], sizeof(colorMask)); - if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT)) { intel->front_buffer_dirty = true; } @@ -115,7 +112,7 @@ intelClear(struct gl_context *ctx, GLbitfield mask) } /* HW color buffers (front, back, aux, generic FBO, etc) */ - if (colorMask == ~0) { + if (GET_COLORMASK(ctx->Color.ColorMask, 0) == 0xf) { /* clear all R,G,B,A */ blit_mask |= (mask & BUFFER_BITS_COLOR); } diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c index 084b5636b48..eaca8e30978 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel.c +++ b/src/mesa/drivers/dri/i915/intel_pixel.c @@ -83,10 +83,7 @@ intel_check_blit_fragment_ops(struct gl_context * ctx, bool src_alpha_is_one) return false; } - if (!(ctx->Color.ColorMask[0][0] && - ctx->Color.ColorMask[0][1] && - ctx->Color.ColorMask[0][2] && - ctx->Color.ColorMask[0][3])) { + if (GET_COLORMASK(ctx->Color.ColorMask, 0) != 0xf) { DBG("fallback due to color masking\n"); return false; } diff --git a/src/mesa/drivers/dri/i915/intel_pixel_copy.c b/src/mesa/drivers/dri/i915/intel_pixel_copy.c index 0dea8f9c796..1b1993ea728 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/i915/intel_pixel_copy.c @@ -130,10 +130,7 @@ do_blit_copypixels(struct gl_context * ctx, return false; } - if (!ctx->Color.ColorMask[0][0] || - !ctx->Color.ColorMask[0][1] || - !ctx->Color.ColorMask[0][2] || - !ctx->Color.ColorMask[0][3]) { + if (GET_COLORMASK(ctx->Color.ColorMask, 0) != 0xf) { perf_debug("glCopyPixels(): Unsupported color mask state\n"); return false; } |