Mesa (master): radeonsi: prevent a gfx10_ngg_calculate_subgroup_info failure for TES+NGG GS

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 16 04:29:05 UTC 2020


Module: Mesa
Branch: master
Commit: 081691b5ae2281e047b75beaa7462c448e74da04
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=081691b5ae2281e047b75beaa7462c448e74da04

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Jun 30 16:57:23 2020 -0400

radeonsi: prevent a gfx10_ngg_calculate_subgroup_info failure for TES+NGG GS

arb_tessellation_shader-tes-gs-max-output -small -scan 1 50 -auto -fbo
doesn't pass, but at least all shaders are compiled successfully.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5700>

---

 src/gallium/drivers/radeonsi/si_state_shaders.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index d1a1aa725cd..01ed224b282 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -2651,9 +2651,15 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
       sel->gs_input_verts_per_prim =
          u_vertices_per_prim(sel->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM]);
 
-      /* EN_MAX_VERT_OUT_PER_GS_INSTANCE does not work with tesselation. */
+      /* EN_MAX_VERT_OUT_PER_GS_INSTANCE does not work with tesselation so
+       * we can't split workgroups. Disable ngg if any of the following conditions is true:
+       * - num_invocations * gs_max_out_vertices > 256
+       * - LDS usage is too high
+       */
       sel->tess_turns_off_ngg = sscreen->info.chip_class >= GFX10 &&
-                                sel->gs_num_invocations * sel->gs_max_out_vertices > 256;
+                                (sel->gs_num_invocations * sel->gs_max_out_vertices > 256 ||
+                                 sel->gs_num_invocations * sel->gs_max_out_vertices *
+                                 (sel->info.num_outputs * 4 + 1) > 6500 /* max dw per GS primitive */);
       break;
 
    case PIPE_SHADER_TESS_CTRL:



More information about the mesa-commit mailing list