ir3: Reduce the maximum allowed imm offset for shared var load/store
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 1 Dec 2022 13:14:23 +0000 (14:14 +0100)
committerEric Engestrom <eric@engestrom.ch>
Wed, 14 Dec 2022 20:47:00 +0000 (20:47 +0000)
commit48e7b3a1f8af101b6d73bb47986bc3afe961d20e
tree08beac7f66362d6d4cec086f04564e6f7deabfc7
parentbd5d599127a080406ca4f5e08f8d0f5c93dbf457
ir3: Reduce the maximum allowed imm offset for shared var load/store

STL/LDL have 13 bits to store imm offset. However the most significant
bit in the offset is a sign bit, so the positive offset is limited by
12 bits.

nir_opt_offsets only has the upper limit and doesn't deal with
negative offsets, so shared_max should be changed to `(1 << 12) - 1`.

The issue was found in "Monster Hunter: World".

Fixes: 0b2da9d795610df15346a594384c39a096be338f
("ir3: Limit the maximum imm offset in nir_opt_offset for shared vars")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20100>
(cherry picked from commit 8f0177b3345f8bcc3673b8a2a7c36ea36cbaa029)
.pick_status.json
src/freedreno/ir3/ir3_nir.c