From: Nicolai Hähnle Date: Tue, 7 May 2019 21:23:03 +0000 (+0200) Subject: radeonsi/gfx10: implement si_build_vgt_shader_config X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5726ec0d242083726dd4f7b47d98e8b53ec79335;p=mesa.git radeonsi/gfx10: implement si_build_vgt_shader_config Acked-by: Bas Nieuwenhuizen --- diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index d7edc7be9ae..a351e5004b1 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -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 diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index a55a6d139d4..5fdc3fab540 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -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)