From 0d046516f325e40727e84f495320c96d20e27a63 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 25 Aug 2020 08:47:30 +0200 Subject: [PATCH] v3dv: only require texel-size alignment for linear images Originally, copies between buffers and images required a buffer offset that was a multiple of 4 bytes, however, the spec was later fixed to relax this rule and only require offsets that had texel alignment. Our implementation of image to buffer copies using the blit path needs to bind the destination buffer as a linear image and be able to bind the requested buffer memory at the required offset, so for that to work we need to chnage the alignment requirements for linear images to match the relaxed texel alignment requirement. Fixes new tests in Vulkan CTS 1.2.4: dEQP-VK.api.copy_and_blit.core.image_to_buffer.buffer_offset_relaxed dEQP-VK.api.copy_and_blit.dedicated_allocation.image_to_buffer.buffer_offset_relaxed Part-of: --- src/broadcom/vulkan/v3dv_image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/broadcom/vulkan/v3dv_image.c b/src/broadcom/vulkan/v3dv_image.c index 787c6b20c00..71c0e78995e 100644 --- a/src/broadcom/vulkan/v3dv_image.c +++ b/src/broadcom/vulkan/v3dv_image.c @@ -211,7 +211,8 @@ v3d_setup_slices(struct v3dv_image *image) * * We additionally align to 4k, which improves UIF XOR performance. */ - image->alignment = image->tiling == VK_IMAGE_TILING_LINEAR ? 4 : 4096; + image->alignment = + image->tiling == VK_IMAGE_TILING_LINEAR ? image->cpp : 4096; uint32_t align_offset = align(image->slices[0].offset, image->alignment) - image->slices[0].offset; if (align_offset) {