radeonsi/gfx10: implement si_build_vgt_shader_config
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 7 May 2019 21:23:03 +0000 (23:23 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:12 +0000 (15:51 -0400)
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_shaders.c

index d7edc7be9ae1639cd879b9f021fff6dc139f0f13..a351e5004b119578d72ae991dda42e0d88ef0907 100644 (file)
@@ -785,7 +785,7 @@ union si_vgt_param_key {
        uint32_t index;
 };
 
-#define SI_NUM_VGT_STAGES_KEY_BITS 2
+#define SI_NUM_VGT_STAGES_KEY_BITS 4
 #define SI_NUM_VGT_STAGES_STATES (1 << SI_NUM_VGT_STAGES_KEY_BITS)
 
 /* The VGT_SHADER_STAGES key used to index the table of precomputed values.
@@ -796,9 +796,13 @@ union si_vgt_stages_key {
 #ifdef PIPE_ARCH_LITTLE_ENDIAN
                unsigned tess:1;
                unsigned gs:1;
+               unsigned ngg:1; /* gfx10+ */
+               unsigned streamout:1; /* only used with NGG */
                unsigned _pad:32 - SI_NUM_VGT_STAGES_KEY_BITS;
 #else /* PIPE_ARCH_BIG_ENDIAN */
                unsigned _pad:32 - SI_NUM_VGT_STAGES_KEY_BITS;
+               unsigned streamout:1;
+               unsigned ngg:1;
                unsigned gs:1;
                unsigned tess:1;
 #endif
index a55a6d139d4c845682189c1177f2b72d79741f36..5fdc3fab5403aafb0fa84edabfc6d56fe8f82e9d 100644 (file)
@@ -3356,14 +3356,22 @@ static struct si_pm4_state *si_build_vgt_shader_config(struct si_screen *screen,
                if (key.u.gs)
                        stages |= S_028B54_ES_EN(V_028B54_ES_STAGE_DS) |
                                  S_028B54_GS_EN(1);
+               else if (key.u.ngg)
+                       stages |= S_028B54_ES_EN(V_028B54_ES_STAGE_DS);
                else
                        stages |= S_028B54_VS_EN(V_028B54_VS_STAGE_DS);
        } else if (key.u.gs) {
                stages |= S_028B54_ES_EN(V_028B54_ES_STAGE_REAL) |
                          S_028B54_GS_EN(1);
+       } else if (key.u.ngg) {
+               stages |= S_028B54_ES_EN(V_028B54_ES_STAGE_REAL);
        }
 
-       if (key.u.gs)
+       if (key.u.ngg) {
+               stages |= S_028B54_PRIMGEN_EN(1);
+               if (key.u.streamout)
+                       stages |= S_028B54_NGG_WAVE_ID_EN(1);
+       } else if (key.u.gs)
                stages |= S_028B54_VS_EN(V_028B54_VS_STAGE_COPY_SHADER);
 
        if (screen->info.chip_class >= GFX9)