radeonsi: skip s_sendmsg(gs_alloc_req) for NGG passthrough on new chips

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8892>
This commit is contained in:
Marek Olšák 2021-01-26 17:43:32 -05:00 committed by Marge Bot
parent d151fcf719
commit 61fd8fc10b
3 changed files with 10 additions and 2 deletions

View File

@ -16802,7 +16802,8 @@
{"bits": [22, 22], "name": "GS_W32_EN"},
{"bits": [23, 23], "name": "VS_W32_EN"},
{"bits": [24, 24], "name": "NGG_WAVE_ID_EN"},
{"bits": [25, 25], "name": "PRIMGEN_PASSTHRU_EN"}
{"bits": [25, 25], "name": "PRIMGEN_PASSTHRU_EN"},
{"bits": [26, 26], "name": "PRIMGEN_PASSTHRU_NO_MSG"}
]
},
"VGT_STRMOUT_BUFFER_CONFIG": {

View File

@ -131,6 +131,11 @@ bool gfx10_ngg_export_prim_early(struct si_shader *shader)
void gfx10_ngg_build_sendmsg_gs_alloc_req(struct si_shader_context *ctx)
{
/* Newer chips can use PRIMGEN_PASSTHRU_NO_MSG to skip gs_alloc_req for NGG passthrough. */
if (gfx10_is_ngg_passthrough(ctx->shader) &&
ctx->screen->info.family >= CHIP_DIMGREY_CAVEFISH)
return;
ac_build_sendmsg_gs_alloc_req(&ctx->ac, get_wave_id_in_tg(ctx), ngg_get_vtx_cnt(ctx),
ngg_get_prim_cnt(ctx));
}

View File

@ -3906,7 +3906,9 @@ static struct si_pm4_state *si_build_vgt_shader_config(struct si_screen *screen,
if (key.u.ngg) {
stages |= S_028B54_PRIMGEN_EN(1) | S_028B54_GS_FAST_LAUNCH(key.u.ngg_gs_fast_launch) |
S_028B54_NGG_WAVE_ID_EN(key.u.streamout) |
S_028B54_PRIMGEN_PASSTHRU_EN(key.u.ngg_passthrough);
S_028B54_PRIMGEN_PASSTHRU_EN(key.u.ngg_passthrough) |
S_028B54_PRIMGEN_PASSTHRU_NO_MSG(key.u.ngg_passthrough &&
screen->info.family >= CHIP_DIMGREY_CAVEFISH);
} else if (key.u.gs)
stages |= S_028B54_VS_EN(V_028B54_VS_STAGE_COPY_SHADER);