Mesa (master): radeonsi: don't insert barrier between VS/TCS if all TCS inputs come from VGPRs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 23 03:15:54 UTC 2020


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Nov 14 17:33:46 2020 -0500

radeonsi: don't insert barrier between VS/TCS if all TCS inputs come from VGPRs

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

---

 src/gallium/drivers/radeonsi/si_shader.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 46b15f74fb5..a11dfdf31de 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1486,7 +1486,12 @@ static bool si_build_main_function(struct si_shader_context *ctx, struct si_shad
          }
 
          if (ctx->stage == MESA_SHADER_TESS_CTRL) {
-            nested_barrier = true;
+            /* We need the barrier only if TCS inputs are read from LDS. */
+            nested_barrier =
+               !shader->key.opt.same_patch_vertices ||
+               shader->selector->info.base.inputs_read &
+               ~shader->selector->tcs_vgpr_only_inputs;
+
             /* The wrapper inserts the conditional for monolithic shaders,
              * and if this is a monolithic shader, we are already inside
              * the conditional, so don't insert it.



More information about the mesa-commit mailing list