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

Author: Rhys Perry <pendingchao...@gmail.com>
Date:   Wed Nov 29 17:10:59 2023 +0000

ac/nir: ignore 8/16-bit global access offset

This was found by inspection, I'm not sure it can even happen.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchao...@gmail.com>
Reviewed-by: Georg Lehmann <dadschoo...@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26402>

---

 src/amd/common/ac_nir_lower_global_access.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/common/ac_nir_lower_global_access.c 
b/src/amd/common/ac_nir_lower_global_access.c
index 64f1a0eb7b8..e760450dcdc 100644
--- a/src/amd/common/ac_nir_lower_global_access.c
+++ b/src/amd/common/ac_nir_lower_global_access.c
@@ -25,6 +25,9 @@ try_extract_additions(nir_builder *b, nir_scalar scalar, 
uint64_t *out_const,
          *out_const += nir_scalar_as_uint(src);
       } else if (nir_scalar_is_alu(src) && nir_scalar_alu_op(src) == 
nir_op_u2u64) {
          nir_scalar offset_scalar = nir_scalar_chase_alu_src(src, 0);
+         if (offset_scalar.def->bit_size != 32)
+            continue;
+
          nir_def *offset = nir_channel(b, offset_scalar.def, 
offset_scalar.comp);
          if (*out_offset)
             *out_offset = nir_iadd(b, *out_offset, offset);

Reply via email to