Mesa (master): r600: Add shader key item to identify when the sample mask should be used

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 20 09:42:30 UTC 2020


Module: Mesa
Branch: master
Commit: c91979c634403bdebeb662cc98c5d77db0d1156a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c91979c634403bdebeb662cc98c5d77db0d1156a

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Sun Jul  5 18:35:35 2020 +0200

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 <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5963>

---

 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;



More information about the mesa-commit mailing list