From 081ea7fc89af636cca483014e49fb0f145835cfa Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Thu, 10 Feb 2022 14:07:12 +0200 Subject: [PATCH] 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 Part-of: (cherry picked from commit 0b2da9d795610df15346a594384c39a096be338f) --- .pick_status.json | 2 +- src/freedreno/ir3/ir3_nir.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d7d5e494c16..94fd5ab5f04 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -517,7 +517,7 @@ "description": "ir3: Limit the maximum imm offset in nir_opt_offset for shared vars", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b024102d7c2959451bfef323432beaa4dca4dd88" }, 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, };