From 8fe8c5dfd08a7582e99c41146e50b21bea5d8485 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 14 Apr 2022 18:57:51 +0100 Subject: [PATCH] ac/nir: properly handle large global access constant offsets MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Timur Kristóf Fixes: 61ac5acca3b ("radv,ac/nir: lower global access to _amd global access intrinsics") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6321 Part-of: --- src/amd/common/ac_nir_lower_global_access.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/common/ac_nir_lower_global_access.c b/src/amd/common/ac_nir_lower_global_access.c index 22a3673..1249dd3 100644 --- a/src/amd/common/ac_nir_lower_global_access.c +++ b/src/amd/common/ac_nir_lower_global_access.c @@ -144,8 +144,10 @@ process_instr(nir_builder *b, nir_instr *instr, void *_) b->cursor = nir_before_instr(&intrin->instr); - if (off_const > UINT32_MAX) + if (off_const > UINT32_MAX) { addr = nir_iadd_imm(b, addr, off_const); + off_const = 0; + } nir_intrinsic_instr *new_intrin = nir_intrinsic_instr_create(b->shader, op); -- 2.7.4