Mesa (staging/22.0): r600: Disable SB when INTERP_SAMPLE is used.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 16:23:33 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 92ad6c6d88bbc18e75158275533b28679ec4e5f7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=92ad6c6d88bbc18e75158275533b28679ec4e5f7

Author: Emma Anholt <emma at anholt.net>
Date:   Thu Jan  6 09:58:46 2022 -0800

r600: Disable SB when INTERP_SAMPLE is used.

Avoids an assertion failure in the SB scheduler.

Cc: mesa-stable
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14429>
(cherry picked from commit 991a95a352996cac75aed1c4cca7cea78a425f40)

Conflicts:
	src/gallium/drivers/r600/ci/r600-turks-fails.txt
	src/gallium/drivers/r600/r600_shader.c

---

 .pick_status.json                      | 2 +-
 src/gallium/drivers/r600/r600_shader.c | 5 +++++
 src/gallium/drivers/r600/r600_shader.h | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index aa8854a7aff..e565f4f5006 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -7556,7 +7556,7 @@
         "description": "r600: Disable SB when INTERP_SAMPLE is used.",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 5,
+        "resolution": 1,
         "because_sha": null
     },
     {
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index d42d3d925dd..f65b6b32d24 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -264,6 +264,9 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
 	 */
 	use_sb &= !(shader->shader.indirect_files & (1 << TGSI_FILE_TEMPORARY));
 
+	/* sb has scheduling assertion fails with interpolate_at. */
+	use_sb &= !shader->shader.uses_interpolate_at_sample;
+
 	/* Check if the bytecode has already been built. */
 	if (!shader->shader.bc.bytecode) {
 		r = r600_bytecode_build(&shader->shader.bc);
@@ -3463,6 +3466,8 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
 	shader->uses_helper_invocation = false;
 	shader->uses_doubles = ctx.info.uses_doubles;
 	shader->uses_atomics = ctx.info.file_mask[TGSI_FILE_HW_ATOMIC];
+	shader->uses_interpolate_at_sample = ctx.info.opcode_count[TGSI_OPCODE_INTERP_SAMPLE] != 0;
+
 	shader->nsys_inputs = 0;
 
 	shader->uses_images = ctx.info.file_count[TGSI_FILE_IMAGE] > 0 ||
diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h
index 8acd9a3af58..8f306c84021 100644
--- a/src/gallium/drivers/r600/r600_shader.h
+++ b/src/gallium/drivers/r600/r600_shader.h
@@ -124,6 +124,7 @@ struct r600_shader {
 	boolean                 uses_atomics;
 	boolean			uses_images;
 	boolean			uses_helper_invocation;
+	boolean			uses_interpolate_at_sample;
 	uint8_t                 atomic_base;
 	uint8_t			rat_base;
 	uint8_t                 image_size_const_offset;



More information about the mesa-commit mailing list