v3dv: fix copy size for image to buffer copies

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>
This commit is contained in:
Iago Toral Quiroga 2020-02-12 13:10:59 +01:00 committed by Marge Bot
parent 1ee270f8c4
commit efbf91cb6c
1 changed files with 4 additions and 7 deletions

View 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 =