panfrost: Add method to get size of AFBC superblocks valid data
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
Mon, 11 Sep 2023 06:52:16 +0000 (02:52 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 25 Oct 2023 14:25:31 +0000 (14:25 +0000)
commit32fbd388895e4590488a63417c36dc342d1737a7
treed72ccf49240cf788ab656c382579bdd6bc6386ad
parentae3fb3089f50a5f7bc42f209656b783ac98ec509
panfrost: Add method to get size of AFBC superblocks valid data

The compute shader is going through all the AFBC header blocks and
calculating the size of valid data by summing up the subblock
sizes (and taking into account solid color, uncompressed mode and
copy blocks). The result is written into the given buffer (array
of `pan_afbc_block_info`).

The size is rounded up to the alignment parameter directly in the
shader.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
src/gallium/drivers/panfrost/pan_afbc_cso.c
src/gallium/drivers/panfrost/pan_afbc_cso.h
src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_resource.c
src/gallium/drivers/panfrost/pan_resource.h
src/gallium/drivers/panfrost/pan_screen.h