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

Author: Marek Olšák <[email protected]>
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 <[email protected]>
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.

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to