Mesa (main): ir3: Limit the maximum imm offset in nir_opt_offset for shared vars

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 14 21:26:43 UTC 2022


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

Author: Danylo Piliaiev <dpiliaiev at igalia.com>
Date:   Thu Feb 10 14:07:12 2022 +0200

ir3: Limit the maximum imm offset in nir_opt_offset for shared vars

STL/LDL have 13 bits to store imm offset.

Fixes crash in CS compilation in Monster Hunter World.

Fixes: b024102d7c2959451bfef323432beaa4dca4dd88
("freedreno/ir3: Use nir_opt_offset for removing constant adds for shared vars.")

Signed-off-by: Danylo Piliaiev <dpiliaiev at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14968>

---

 src/freedreno/ir3/ir3_nir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c
index 25029dc2c99..b8f1dbeac4c 100644
--- a/src/freedreno/ir3/ir3_nir.c
+++ b/src/freedreno/ir3/ir3_nir.c
@@ -124,7 +124,7 @@ ir3_optimize_loop(struct ir3_compiler *compiler, nir_shader *s)
           */
          .uniform_max = (1 << 9) - 1,
 
-         .shared_max = ~0,
+         .shared_max = (1 << 13) - 1,
 
          .buffer_max = ~0,
       };



More information about the mesa-commit mailing list