Mesa (staging/21.3): radeonsi: treat nir_intrinsic_load_constant as a VMEM operation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 4 22:59:17 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: 3ed2c02b7d8d908ed4156ecdafb11873fcb86786
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ed2c02b7d8d908ed4156ecdafb11873fcb86786

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Wed Oct 27 14:44:54 2021 +0200

radeonsi: treat nir_intrinsic_load_constant as a VMEM operation

This is used by variable indexing of constant arrays, to build
code like this:

   s_add_u32 s6, s6, const_data at rel32@lo+4
   s_addc_u32 s7, s7, const_data at rel32@hi+12
   [...]
   global_load_dword v4, v4, s[6:7

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5118
Fixes: 8288882965b ("radeonsi: set MEM_ORDERED optimally")
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13550>
(cherry picked from commit dc56301f78494bea67f0c57d5aa77fef42bfe455)

---

 .pick_status.json                            | 2 +-
 src/gallium/drivers/radeonsi/si_shader_nir.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index bc89553ab31..b7164f524b0 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -418,7 +418,7 @@
         "description": "radeonsi: treat nir_intrinsic_load_constant as a VMEM operation",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "8288882965bf1c5f0ca5d9f29c1b759bee2bc718"
     },
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index ed07fa7e0a7..3d968dcda8a 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -245,6 +245,9 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
             if (!nir_src_is_const(intr->src[1]))
                info->uses_vmem_return_type_other = true;
             break;
+         case nir_intrinsic_load_constant:
+            info->uses_vmem_return_type_other = true;
+            break;
 
          case nir_intrinsic_load_barycentric_at_sample: /* This loads sample positions. */
          case nir_intrinsic_load_tess_level_outer: /* TES input read from memory */



More information about the mesa-commit mailing list