radv: fix copying 2D to 3D images

CTS is testing 2D to 3D image copies but the checks are incomplete and
we used to only copy the first slice.

This should fix
dEQP-GLES31.functional.copy_image.non_compressed.*.texture2d_array_to_texture3d
with ANGLE.

Cc: mesa-stable
Suggested-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23231>
This commit is contained in:
Samuel Pitoiset
2023-05-25 10:44:11 +02:00
committed by Marge Bot
parent 395450c5b1
commit d2d07a7262
+6 -12
View File
@@ -497,19 +497,17 @@ copy_image(struct radv_cmd_buffer *cmd_buffer, struct radv_image *src_image,
.height = img_extent_el.height,
};
if (src_image->vk.image_type == VK_IMAGE_TYPE_3D)
unsigned num_slices = region->srcSubresource.layerCount;
if (src_image->vk.image_type == VK_IMAGE_TYPE_3D) {
b_src.layer = src_offset_el.z;
num_slices = img_extent_el.depth;
}
if (dst_image->vk.image_type == VK_IMAGE_TYPE_3D)
b_dst.layer = dst_offset_el.z;
/* Loop through each 3D or array slice */
unsigned num_slices_3d = img_extent_el.depth;
unsigned num_slices_array = region->dstSubresource.layerCount;
unsigned slice_3d = 0;
unsigned slice_array = 0;
while (slice_3d < num_slices_3d && slice_array < num_slices_array) {
for (unsigned slice = 0; slice < num_slices; slice++) {
/* Finish creating blit rect */
rect.dst_x = dst_offset_el.x;
rect.dst_y = dst_offset_el.y;
@@ -529,10 +527,6 @@ copy_image(struct radv_cmd_buffer *cmd_buffer, struct radv_image *src_image,
b_src.layer++;
b_dst.layer++;
if (dst_image->vk.image_type == VK_IMAGE_TYPE_3D)
slice_3d++;
else
slice_array++;
}
}