Mesa (main): intel/compiler: Don't lower Mesh/Task I/O to temporaries

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 4 01:33:16 UTC 2021


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

Author: Caio Oliveira <caio.oliveira at intel.com>
Date:   Fri Oct 29 12:10:00 2021 -0700

intel/compiler: Don't lower Mesh/Task I/O to temporaries

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13661>

---

 src/intel/compiler/brw_nir.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
index 6d9d0cef88a..262a00793e5 100644
--- a/src/intel/compiler/brw_nir.c
+++ b/src/intel/compiler/brw_nir.c
@@ -921,12 +921,18 @@ brw_nir_link_shaders(const struct brw_compiler *compiler,
    NIR_PASS_V(producer, nir_opt_combine_stores, nir_var_shader_out);
    NIR_PASS_V(consumer, nir_lower_io_to_vector, nir_var_shader_in);
 
-   if (producer->info.stage != MESA_SHADER_TESS_CTRL) {
+   if (producer->info.stage != MESA_SHADER_TESS_CTRL &&
+       producer->info.stage != MESA_SHADER_MESH &&
+       producer->info.stage != MESA_SHADER_TASK) {
       /* Calling lower_io_to_vector creates output variable writes with
        * write-masks.  On non-TCS outputs, the back-end can't handle it and we
        * need to call nir_lower_io_to_temporaries to get rid of them.  This,
        * in turn, creates temporary variables and extra copy_deref intrinsics
        * that we need to clean up.
+       *
+       * Note Mesh/Task don't support I/O as temporaries (I/O is shared
+       * between whole workgroup, possibly using multiple HW threads). For
+       * those write-mask in output is handled by I/O lowering.
        */
       NIR_PASS_V(producer, nir_lower_io_to_temporaries,
                  nir_shader_get_entrypoint(producer), true, false);



More information about the mesa-commit mailing list