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.
b0af413edf3 v3dv: implement partial image to buffer copies
src/broadcom/vulkan/v3dv_meta_copy.c | 355 +++++++++++++++++++++++++++++++----
src/broadcom/vulkan/v3dv_private.h | 2 +-
2 files changed, 321 insertions(+), 36 deletions(-)