ir3/analyze_ubo_ranges: Account for reserved consts better
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 26 Sep 2022 16:31:48 +0000 (18:31 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 4 Oct 2022 14:00:50 +0000 (14:00 +0000)
commitdcab399a173f2ab99f408e2db1bafc114c29cfd9
tree18cbbfb4a723769b6841297bf9f2454b6eafd1bc
parentc58d633dd2f01d01352bf6fbb9c59b70a42f7347
ir3/analyze_ubo_ranges: Account for reserved consts better

It turns out that the ir3_setup_const_state() already includes reserved
consts, so we were accidentally counting it twice. This makes us use
less consts, and if there are enough reserved consts can make it go
negative and wrap around. Fix this while also making sure the previous
bug remains fixed.

Fixes: 8cb1deded60 ("ir3/analyze_ubo_ranges: Account for reserved consts")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18840>
src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c