Mesa (main): intel/fs: Ignore SLM fences if shared is unused

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 29 21:12:21 UTC 2021


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Sep 17 07:45:46 2021 -0500

intel/fs: Ignore SLM fences if shared is unused

Found this nugget while looking at the ACO driver.  It seems sensible to
avoid SLM fences if there is no SLM.  This also makes the check depend
on SLM usage rather than just shader stage which will be useful if we
ever implement task/mesh because task shaders also have SLM.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13092>

---

 src/intel/compiler/brw_fs_nir.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 4c1c6376a5a..5a02f48e8fd 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -4477,8 +4477,11 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
          break;
       }
 
-      if (stage != MESA_SHADER_COMPUTE && stage != MESA_SHADER_KERNEL)
+      if (nir->info.shared_size > 0) {
+         assert(gl_shader_stage_uses_workgroup(stage));
+      } else {
          slm_fence = false;
+      }
 
       /* If the workgroup fits in a single HW thread, the messages for SLM are
        * processed in-order and the shader itself is already synchronized so



More information about the mesa-commit mailing list