radeonsi: add AMD_DEBUG=nofastlaunch for debugging

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7721>
This commit is contained in:
Marek Olšák 2020-11-24 00:09:54 -05:00
parent de799b2270
commit 509142876b
5 changed files with 9 additions and 4 deletions

View File

@ -94,6 +94,7 @@ static const struct debug_named_value debug_options[] = {
/* 3D engine options: */
{"nogfx", DBG(NO_GFX), "Disable graphics. Only multimedia compute paths can be used."},
{"nongg", DBG(NO_NGG), "Disable NGG and use the legacy pipeline."},
{"nofastlaunch", DBG(NO_FAST_LAUNCH), "Disable NGG GS fast launch."},
{"nggc", DBG(ALWAYS_NGG_CULLING_ALL), "Always use NGG culling even when it can hurt."},
{"nggctess", DBG(ALWAYS_NGG_CULLING_TESS), "Always use NGG culling for tessellation."},
{"nonggc", DBG(NO_NGG_CULLING), "Disable NGG culling."},

View File

@ -191,6 +191,7 @@ enum
DBG_ALWAYS_NGG_CULLING_ALL,
DBG_ALWAYS_NGG_CULLING_TESS,
DBG_NO_NGG_CULLING,
DBG_NO_FAST_LAUNCH,
DBG_ALWAYS_PD,
DBG_PD,
DBG_NO_PD,

View File

@ -433,8 +433,8 @@ struct si_shader_selector {
ubyte num_vs_inputs;
ubyte num_vbos_in_user_sgprs;
unsigned pa_cl_vs_out_cntl;
unsigned ngg_cull_vert_threshold; /* 0 = disabled */
unsigned ngg_cull_nonindexed_fast_launch_vert_threshold; /* 0 = disabled */
unsigned ngg_cull_vert_threshold; /* UINT32_MAX = disabled */
unsigned ngg_cull_nonindexed_fast_launch_vert_threshold; /* UINT32_MAX = disabled */
ubyte clipdist_mask;
ubyte culldist_mask;
ubyte rast_prim;

View File

@ -2169,7 +2169,9 @@ static void si_draw_vbo(struct pipe_context *ctx,
/* Use NGG fast launch for certain primitive types.
* A draw must have at least 1 full primitive.
*/
if (ngg_culling && min_direct_count >= 3 && !sctx->tes_shader.cso &&
if (ngg_culling &&
hw_vs->ngg_cull_nonindexed_fast_launch_vert_threshold < UINT32_MAX &&
min_direct_count >= 3 && !sctx->tes_shader.cso &&
!sctx->gs_shader.cso) {
if (prim == PIPE_PRIM_TRIANGLES && !index_size) {
ngg_culling |= SI_NGG_CULL_GS_FAST_LAUNCH_TRI_LIST;

View File

@ -2817,7 +2817,8 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
/* 1000 non-indexed vertices (roughly 8 primgroups) are needed
* per draw call (no TES/GS) to enable NGG culling by default.
*/
sel->ngg_cull_nonindexed_fast_launch_vert_threshold = 1000;
if (!(sscreen->debug_flags & DBG(NO_FAST_LAUNCH)))
sel->ngg_cull_nonindexed_fast_launch_vert_threshold = 1000;
if (sscreen->debug_flags & DBG(ALWAYS_NGG_CULLING_ALL))
sel->ngg_cull_vert_threshold = 0; /* always enabled */