agx: Fix 2D MSAA array texture register allocation
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sat, 4 Mar 2023 16:21:57 +0000 (11:21 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sun, 5 Mar 2023 08:06:43 +0000 (08:06 +0000)
commit8bb40ce4ad2418eaca9816c0facebc6e40204872
tree1c1d7e80199af447eb8f8cac5bb6f6547b7b160e
parent3032e3ad23d41488c0eb4c76dcda27c7730dca36
agx: Fix 2D MSAA array texture register allocation

Sample index and layer index are both 16-bits, even though they are zero
extended for compiler simplicity in some cases. In particular this means that 2D
MSAA arrays consume 6 half-regs for their coordinates, not 8. This is what the
IR translation (actually agx_nir_lower_texture) produces, we just need to fix
the calculation in agx_read_registers to agree.

Fixes validation failure in tests like
dEQP-GLES31.functional.texture.multisample.samples_4.use_texture_color_2d_array

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21708>
src/asahi/compiler/agx_register_allocate.c