vk/meta: Fix dest format of vkCmdCopyImage
authorChad Versace <chad.versace@intel.com>
Tue, 18 Aug 2015 19:39:28 +0000 (12:39 -0700)
committerChad Versace <chad.versace@intel.com>
Tue, 18 Aug 2015 19:44:06 +0000 (12:44 -0700)
The source image's format was incorrectly used for both the source view
and destination view. For vkCmdCopyImage to correctly translate formats,
the destination view's format must be that of the destination image's.

src/vulkan/anv_meta.c

index bec8455c87374c6278c796e1df3a7c947065a819..a433d132562f6381f6c5a061c9e556c99c2a6f71 100644 (file)
@@ -899,6 +899,7 @@ void anv_CmdCopyImage(
 {
    ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
    ANV_FROM_HANDLE(anv_image, src_image, srcImage);
+   ANV_FROM_HANDLE(anv_image, dest_image, destImage);
 
    struct anv_saved_state saved_state;
 
@@ -933,7 +934,7 @@ void anv_CmdCopyImage(
          &(VkAttachmentViewCreateInfo) {
             .sType = VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO,
             .image = destImage,
-            .format = src_image->format->vk_format,
+            .format = dest_image->format->vk_format,
             .mipLevel = pRegions[r].destSubresource.mipLevel,
             .baseArraySlice = pRegions[r].destSubresource.arraySlice,
             .arraySize = 1,