diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 11dca552356..a04c4a3f9fc 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -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."}, diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 20230556744..d14fe6916dd 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -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, diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 767247b75b6..1f06324e562 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 2acb1337b85..831555a0f54 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index f822229d836..e57727bb4d3 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -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 */