radeonsi/gfx10: add as_ngg variant for VS as ES to select Wave32/64
authorMarek Olšák <marek.olsak@amd.com>
Wed, 21 Aug 2019 00:39:08 +0000 (20:39 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 27 Aug 2019 20:16:08 +0000 (16:16 -0400)
Legacy GS only works with Wave64.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index 7acef0cfef4846d1f30770069840a97539f0006c..c9a415622c35bf562defcfff05e13341c1c38f18 100644 (file)
@@ -1903,7 +1903,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
index 28003d1bad27a58df73d126acc188af1bbff95b8..3b4bed70b2d6e647b1a63aab6addb1e3bf30e70f 100644 (file)
@@ -7709,7 +7709,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;
index d0a82ac47df49e4427984983846eac01723341c4..def27b1e6859fb64d68cf5bd976b6beebf68b06f 100644 (file)
@@ -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;