Mesa (main): radeonsi: enable shader culling on Navi1x consumer SKUs as well

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 18 18:36:12 UTC 2021


Module: Mesa
Branch: main
Commit: cbcdcd42fcd43dd0c60f6805e3fdd03c817ca265
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbcdcd42fcd43dd0c60f6805e3fdd03c817ca265

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Oct 16 12:21:30 2021 -0400

radeonsi: enable shader culling on Navi1x consumer SKUs as well

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at 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 81880be5950..3ad4a9dcef0 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 7d378857377..525c6b705dd 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 72e5e7e5c14..763af1a58d9 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 e88de31a725..234f791ca25 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 9926836c1bf..aeb36509007 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" />



More information about the mesa-commit mailing list