v3dv: fix copy size for image to buffer copies
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 12 Feb 2020 12:10:59 +0000 (13:10 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:27 +0000 (21:21 +0000)
For some reason we were ignoring the extent to copy that was
passed in the region to copy and instead we were computing a
a region based on the image size and the selected miplevel.

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

src/broadcom/vulkan/v3dv_meta_copy.c

index b062b0d..e48d48b 100644 (file)
@@ -483,14 +483,11 @@ copy_image_to_buffer_tlb(struct v3dv_cmd_buffer *cmd_buffer,
    uint32_t num_layers = region->imageSubresource.layerCount;
    assert(num_layers > 0);
 
-   uint32_t width =
-      u_minify(image->extent.width, region->imageSubresource.mipLevel);
-   uint32_t height =
-      u_minify(image->extent.height, region->imageSubresource.mipLevel);
-
    struct fake_framebuffer framebuffer;
-   setup_framebuffer_params(&framebuffer, width, height, num_layers,
-                            internal_bpp, internal_type);
+   setup_framebuffer_params(&framebuffer,
+                            region->imageExtent.width,
+                            region->imageExtent.height,
+                            num_layers, internal_bpp, internal_type);
 
    /* Limit supertile coverage to the requested region  */
    uint32_t supertile_w_in_pixels =