ir3: Limit the maximum imm offset in nir_opt_offset for shared vars
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 10 Feb 2022 12:07:12 +0000 (14:07 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Feb 2022 20:56:46 +0000 (20:56 +0000)
commit0b2da9d795610df15346a594384c39a096be338f
treea24aa7082da53568605f7c178ef78c281c52be0e
parentb6557b80a50aa96ac0862bc029d72625ea4dd6db
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@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14968>
src/freedreno/ir3/ir3_nir.c