From cbcdcd42fcd43dd0c60f6805e3fdd03c817ca265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com> Date: Sat, 16 Oct 2021 12:21:30 -0400 Subject: [PATCH] radeonsi: enable shader culling on Navi1x consumer SKUs as well Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13393> --- src/gallium/drivers/radeonsi/si_debug_options.h | 1 - src/gallium/drivers/radeonsi/si_pipe.c | 1 - src/gallium/drivers/radeonsi/si_pipe.h | 1 - src/gallium/drivers/radeonsi/si_state_shaders.cpp | 11 ++--------- src/util/00-mesa-defaults.conf | 1 - 5 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_debug_options.h b/src/gallium/drivers/radeonsi/si_debug_options.h index 81880be5950bb..3ad4a9dcef0ef 100644 --- a/src/gallium/drivers/radeonsi/si_debug_options.h +++ b/src/gallium/drivers/radeonsi/si_debug_options.h @@ -10,7 +10,6 @@ OPT_BOOL(vs_fetch_always_opencode, false, OPT_BOOL(prim_restart_tri_strips_only, false, "Only enable primitive restart for triangle strips") OPT_BOOL(no_infinite_interp, false, "Kill PS with infinite interp coeff") OPT_BOOL(clamp_div_by_zero, false, "Clamp div by zero (x / 0 becomes FLT_MAX instead of NaN)") -OPT_BOOL(shader_culling, false, "Cull primitives in shaders when benefical (without tess and GS)") OPT_BOOL(vrs2x2, false, "Enable 2x2 coarse shading for non-GUI elements") OPT_BOOL(enable_sam, false, "Enable Smart Access Memory with Above 4G Decoding for unvalidated platforms.") OPT_BOOL(disable_sam, false, "Disable Smart Access Memory.") diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 7d37885737712..525c6b705ddaa 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -94,7 +94,6 @@ static const struct debug_named_value radeonsi_debug_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."}, {"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."}, {"switch_on_eop", DBG(SWITCH_ON_EOP), "Program WD/IA to switch on end-of-packet."}, {"nooutoforder", DBG(NO_OUT_OF_ORDER), "Disable out-of-order rasterization"}, diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 72e5e7e5c1454..763af1a58d946 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -217,7 +217,6 @@ enum DBG_NO_GFX, DBG_NO_NGG, DBG_ALWAYS_NGG_CULLING_ALL, - DBG_ALWAYS_NGG_CULLING_TESS, DBG_NO_NGG_CULLING, DBG_SWITCH_ON_EOP, DBG_NO_OUT_OF_ORDER, diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp index e88de31a7253d..234f791ca25b2 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp +++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp @@ -3039,17 +3039,10 @@ static void *si_create_shader_selector(struct pipe_context *ctx, if (sel->info.stage == MESA_SHADER_VERTEX) { if (sscreen->debug_flags & DBG(ALWAYS_NGG_CULLING_ALL)) sel->ngg_cull_vert_threshold = 0; /* always enabled */ - else if (sscreen->options.shader_culling || - sscreen->info.chip_class == GFX10_3 || - (sscreen->info.chip_class == GFX10 && - sscreen->info.is_pro_graphics)) { + else sel->ngg_cull_vert_threshold = 128; - } } else if (sel->info.stage == MESA_SHADER_TESS_EVAL) { - if (sel->rast_prim != PIPE_PRIM_POINTS && - (sscreen->debug_flags & DBG(ALWAYS_NGG_CULLING_ALL) || - sscreen->debug_flags & DBG(ALWAYS_NGG_CULLING_TESS) || - sscreen->info.chip_class == GFX10_3)) + if (sel->rast_prim != PIPE_PRIM_POINTS) sel->ngg_cull_vert_threshold = 0; /* always enabled */ } } diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index 9926836c1bff0..aeb3650900724 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -769,7 +769,6 @@ TODO: document the other workarounds. <option name="radeonsi_sync_compile" value="true" /> <option name="radeonsi_clamp_div_by_zero" value="true" /> <option name="radeonsi_inline_uniforms" value="true" /> - <option name="radeonsi_shader_culling" value="true" /> </application> <application name="Road Redemption" executable="RoadRedemption.x86_64"> <option name="radeonsi_clamp_div_by_zero" value="true" /> -- GitLab