freedreno: Fix non-constbuf-upload UBO block indices and count.
authorEric Anholt <eric@anholt.net>
Mon, 11 May 2020 18:18:02 +0000 (11:18 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 12 May 2020 17:01:55 +0000 (17:01 +0000)
commitf789c5975c83f12216cf915d9a791e654b3c9e15
treec6810f2b0c6b9fa2e83cf57e5731162b0cbff618
parent4553fc66a5f23607c2e872d8ac8755c747bd0bd2
freedreno: Fix non-constbuf-upload UBO block indices and count.

The nir_analyze_ubo_ranges pass removes all UBO block 0 loads to reverse
what nir_lower_uniforms_to_ubo() had done, and we only upload UBO pointers
to the HW for UBO block 1-N, so let's just fix up the shader state.

Fixes an off by one in const state layout setup, and some really dodgy
register addressing trying to deal with dynamic UBO indices when the UBO
pointers happen to be at the start of the constbuf.

There's no fixes tag, though this fixes a bug from September, because it
would require the num_ubos fix in nir_lower_uniforms_to_ubo.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4992>
.gitlab-ci/deqp-freedreno-a630-noubo-fails.txt
src/freedreno/ir3/ir3_compiler_nir.c
src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c