Mesa (19.2): radeonsi/gfx10: add as_ngg variant for VS as ES to select Wave32/64

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 28 03:17:31 UTC 2019


Module: Mesa
Branch: 19.2
Commit: 4d3097f36ae52aa37f8e552920428f5996d009b4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d3097f36ae52aa37f8e552920428f5996d009b4

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Aug 20 20:39:08 2019 -0400

radeonsi/gfx10: add as_ngg variant for VS as ES to select Wave32/64

Legacy GS only works with Wave64.

---

 src/gallium/drivers/radeonsi/si_pipe.h          |  3 ++-
 src/gallium/drivers/radeonsi/si_shader.c        |  2 +-
 src/gallium/drivers/radeonsi/si_state_shaders.c | 20 +++++++++-----------
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 7fd13cfa9e7..89b8e35e648 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1912,7 +1912,8 @@ static inline unsigned si_get_wave_size(struct si_screen *sscreen,
 		return sscreen->compute_wave_size;
 	else if (shader_type == PIPE_SHADER_FRAGMENT)
 		return sscreen->ps_wave_size;
-	else if ((shader_type == PIPE_SHADER_TESS_EVAL && es && !ngg) ||
+	else if ((shader_type == PIPE_SHADER_VERTEX && es && !ngg) ||
+		 (shader_type == PIPE_SHADER_TESS_EVAL && es && !ngg) ||
 		 (shader_type == PIPE_SHADER_GEOMETRY && !ngg)) /* legacy GS only supports Wave64 */
 		return 64;
 	else
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 64d7ec08348..cdee24c01d0 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -7727,7 +7727,7 @@ static bool si_shader_select_gs_parts(struct si_screen *sscreen,
 		struct si_shader *es_main_part;
 		enum pipe_shader_type es_type = shader->key.part.gs.es->type;
 
-		if (es_type == PIPE_SHADER_TESS_EVAL && shader->key.as_ngg)
+		if (shader->key.as_ngg)
 			es_main_part = shader->key.part.gs.es->main_shader_part_ngg_es;
 		else
 			es_main_part = shader->key.part.gs.es->main_shader_part_es;
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index ae608509a8e..0c0b79a3e73 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1834,9 +1834,10 @@ static inline void si_shader_selector_key(struct pipe_context *ctx,
 
 		if (sctx->tes_shader.cso)
 			key->as_ls = 1;
-		else if (sctx->gs_shader.cso)
+		else if (sctx->gs_shader.cso) {
 			key->as_es = 1;
-		else {
+			key->as_ngg = stages_key.u.ngg;
+		} else {
 			key->as_ngg = stages_key.u.ngg;
 			si_shader_selector_key_hw_vs(sctx, sel, key);
 
@@ -2284,16 +2285,14 @@ current_not_ready:
 		if (previous_stage_sel) {
 			struct si_shader_key shader1_key = zeroed;
 
-			if (sel->type == PIPE_SHADER_TESS_CTRL)
+			if (sel->type == PIPE_SHADER_TESS_CTRL) {
 				shader1_key.as_ls = 1;
-			else if (sel->type == PIPE_SHADER_GEOMETRY)
+			} else if (sel->type == PIPE_SHADER_GEOMETRY) {
 				shader1_key.as_es = 1;
-			else
+				shader1_key.as_ngg = key->as_ngg; /* for Wave32 vs Wave64 */
+			} else {
 				assert(0);
-
-			if (sel->type == PIPE_SHADER_GEOMETRY &&
-			    previous_stage_sel->type == PIPE_SHADER_TESS_EVAL)
-				shader1_key.as_ngg = key->as_ngg;
+			}
 
 			mtx_lock(&previous_stage_sel->mutex);
 			ok = si_check_missing_main_part(sscreen,
@@ -2480,8 +2479,7 @@ static void si_init_shader_selector_async(void *job, int thread_index)
 
 		if (sscreen->use_ngg &&
 		    (!sel->so.num_outputs || sscreen->use_ngg_streamout) &&
-		    ((sel->type == PIPE_SHADER_VERTEX &&
-		      !shader->key.as_ls && !shader->key.as_es) ||
+		    ((sel->type == PIPE_SHADER_VERTEX && !shader->key.as_ls) ||
 		     sel->type == PIPE_SHADER_TESS_EVAL ||
 		     sel->type == PIPE_SHADER_GEOMETRY))
 			shader->key.as_ngg = 1;




More information about the mesa-commit mailing list