radeonsi: reduce the frequency of switching GS fast launch on/off
authorMarek Olšák <marek.olsak@amd.com>
Wed, 18 Aug 2021 15:14:26 +0000 (11:14 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 10 Sep 2021 23:32:03 +0000 (23:32 +0000)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12812>

src/gallium/drivers/radeonsi/si_state_draw.cpp

index f4a6ef7..f8084e8 100644 (file)
@@ -1854,11 +1854,11 @@ static void si_draw_vbo(struct pipe_context *ctx,
           * A draw must have at least 1 full primitive.
           * The fast launch doesn't work with tessellation.
           *
-          * Small instances (including small draws) don't perform well with fast launch.
-          * It's better to use normal launch with NOT_EOP for small draws, and it's
-          * always better to use normal launch for small instances.
+          * Since NGG fast launch is enabled by VGT_SHADER_STAGES_EN, which causes a context roll,
+          * which decreases performance, decrease the frequency of switching it on/off using
+          * a high vertex count threshold.
           */
-         if (!HAS_TESS && ngg_culling && min_direct_count >= 64 &&
+         if (!HAS_TESS && ngg_culling && total_direct_count >= 8000 &&
              !(sctx->screen->debug_flags & DBG(NO_FAST_LAUNCH))) {
             if (prim == PIPE_PRIM_TRIANGLES && !index_size) {
                ngg_culling |= SI_NGG_CULL_GS_FAST_LAUNCH_TRI_LIST;