v3dv: implement partial image to buffer copies
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 11 May 2020 06:14:15 +0000 (08:14 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:30 +0000 (21:21 +0000)
commitb0af413edf389f5db31f98121aece8d592b1c74e
tree635b54bcaa14a861ef213691b22855024636fdff
parentf1b1d5bb8e7a4cbcbc0ab8bcba30d9c36b68f5d4
v3dv: implement partial image to buffer copies

We implement this by blitting the requested region to a linear image
setup to use the buffer memory store at the requested offset.

Because we can't store linear depth/stencil images, we implement
copies of depth/stencil aspects by using a compatible color blit.
To do this, we also need to account for the fact that when we are
copying depth from a d24 format we need to copy them from the MSB
24-bits of each word as provided by the hardware and store them
in the LSB 24-bit of the buffer (as per Vulkan requirements). This
is achieved by expanding our blit interface to also accept a swizzle
to apply to the source texture.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
src/broadcom/vulkan/v3dv_meta_copy.c
src/broadcom/vulkan/v3dv_private.h