ir3/a6xx,freedreno: account for resinfo return size dependency on IBO_0_FMT
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Mon, 30 Aug 2021 09:25:46 +0000 (12:25 +0300)
committerDanylo Piliaiev <dpiliaiev@igalia.com>
Wed, 1 Sep 2021 13:09:20 +0000 (16:09 +0300)
commit6373dd814a74d84becbbbfc42673df147adb6e9b
tree9a55d877b6244402d5f9b76b968fedd41a9e7eca
parente8cbfa95a3a1d7ca1db235ae03fd76a698d5a556
ir3/a6xx,freedreno: account for resinfo return size dependency on IBO_0_FMT

On a6xx resinfo returns size in bytes divided by IBO_0_FMT format size
(not just size in dwords), we have to shift it back to NIR meaning which
is size in bytes.

Make freedreno use 16b buffers when they are supported in order to be
able to depend on hardware capabilities when lowering ssbo size.

Fixes: ce1a381e57d2803246c8a27f52f3dea2d2bfbfb1 "turnip: enable VK_KHR_16bit_storage on A650"

Fixes cts tests:
    dEQP-VK.ssbo.unsized_array_length.float_offset_explicit_size
    dEQP-VK.ssbo.unsized_array_length.float_no_offset_whole_size
    dEQP-VK.compute.basic.write_multiple_unsized_arr_single_invocation
and many more

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12485>
src/freedreno/ir3/ir3_compiler.c
src/freedreno/ir3/ir3_compiler.h
src/freedreno/ir3/ir3_nir.c
src/gallium/drivers/freedreno/a6xx/fd6_image.c