From c91979c634403bdebeb662cc98c5d77db0d1156a Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 5 Jul 2020 18:35:35 +0200 Subject: [PATCH] r600: Add shader key item to identify when the sample mask should be used The sample mask must be applied when more then one sample is available or multisamplig is not enabled, so add a shader key to track this. Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/r600_shader.h | 1 + src/gallium/drivers/r600/r600_state_common.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h index 1e00a9527b5..4e4942c1ba4 100644 --- a/src/gallium/drivers/r600/r600_shader.h +++ b/src/gallium/drivers/r600/r600_shader.h @@ -136,6 +136,7 @@ union r600_shader_key { unsigned image_size_const_offset:5; unsigned color_two_side:1; unsigned alpha_to_one:1; + unsigned apply_sample_id_mask:1; } ps; struct { unsigned prim_id_out:8; diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index 44c88548b8b..89429dd504e 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -819,6 +819,7 @@ static inline void r600_shader_selector_key(const struct pipe_context *ctx, rctx->rasterizer && rctx->rasterizer->multisample_enable && !rctx->framebuffer.cb0_is_integer; key->ps.nr_cbufs = rctx->framebuffer.state.nr_cbufs; + key->ps.apply_sample_id_mask = (rctx->ps_iter_samples > 1) || !rctx->rasterizer->multisample_enable; /* Dual-source blending only makes sense with nr_cbufs == 1. */ if (key->ps.nr_cbufs == 1 && rctx->dual_src_blend) key->ps.nr_cbufs = 2; -- 2.30.2