v3dv: fix buffer automatic stride for image to buffer copies
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 13 Feb 2020 10:34:09 +0000 (11:34 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:27 +0000 (21:21 +0000)
When the client requests a tightly packet copy, we should take
the stride from the size of the region to copy, not from the size
of the image (which can be larger).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>

src/broadcom/vulkan/v3dv_meta_copy.c

index 00e84f9..ffd2fba 100644 (file)
@@ -508,12 +508,12 @@ emit_copy_layer_to_buffer_per_tile_list(struct v3dv_job *job,
    /* Store TLB to buffer */
    uint32_t width, height;
    if (region->bufferRowLength == 0)
-      width = image->extent.width;
+      width = region->imageExtent.width;
    else
       width = region->bufferRowLength;
 
    if (region->bufferImageHeight == 0)
-      height = image->extent.height;
+      height = region->imageExtent.height;
    else
       height = region->bufferImageHeight;