Module: Mesa Branch: main Commit: 811f289c56114491cd04c0e8f823e062ce323d69 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=811f289c56114491cd04c0e8f823e062ce323d69
Author: Danylo Piliaiev <dpilia...@igalia.com> Date: Mon May 10 20:52:53 2021 +0300 turnip: copy all layers specified in vkCmdCopyImage When copying layered images we ignored .layerCount parameter. Fixes mis-rendering of walls in D3D11 game "Company Of Heroes 2". Signed-off-by: Danylo Piliaiev <dpilia...@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10736> --- src/freedreno/vulkan/tu_clear_blit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/freedreno/vulkan/tu_clear_blit.c b/src/freedreno/vulkan/tu_clear_blit.c index d1593cbd236..39d5b15c871 100644 --- a/src/freedreno/vulkan/tu_clear_blit.c +++ b/src/freedreno/vulkan/tu_clear_blit.c @@ -1427,6 +1427,7 @@ tu_copy_image_to_image(struct tu_cmd_buffer *cmd, VkOffset3D src_offset = info->srcOffset; VkOffset3D dst_offset = info->dstOffset; VkExtent3D extent = info->extent; + uint32_t layers_to_copy = MAX2(info->extent.depth, info->srcSubresource.layerCount); /* From the Vulkan 1.2.140 spec, section 19.3 "Copying Data Between * Images": @@ -1537,7 +1538,7 @@ tu_copy_image_to_image(struct tu_cmd_buffer *cmd, ops->setup(cmd, cs, src_format, VK_IMAGE_ASPECT_COLOR_BIT, 0, false, false); coords(ops, cs, &staging_offset, &src_offset, &extent); - for (uint32_t i = 0; i < info->extent.depth; i++) { + for (uint32_t i = 0; i < layers_to_copy; i++) { ops->src(cmd, cs, &src, i, VK_FILTER_NEAREST); ops->dst(cs, &staging, i); ops->run(cmd, cs); @@ -1556,7 +1557,7 @@ tu_copy_image_to_image(struct tu_cmd_buffer *cmd, 0, false, dst_image->layout[0].ubwc); coords(ops, cs, &dst_offset, &staging_offset, &extent); - for (uint32_t i = 0; i < info->extent.depth; i++) { + for (uint32_t i = 0; i < layers_to_copy; i++) { ops->src(cmd, cs, &staging, i, VK_FILTER_NEAREST); ops->dst(cs, &dst, i); ops->run(cmd, cs); @@ -1569,7 +1570,7 @@ tu_copy_image_to_image(struct tu_cmd_buffer *cmd, 0, false, dst_image->layout[0].ubwc); coords(ops, cs, &dst_offset, &src_offset, &extent); - for (uint32_t i = 0; i < info->extent.depth; i++) { + for (uint32_t i = 0; i < layers_to_copy; i++) { ops->src(cmd, cs, &src, i, VK_FILTER_NEAREST); ops->dst(cs, &dst, i); ops->run(cmd, cs); _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit