radv: clean up radv_decompress_resolve_subpass_src()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 13 Apr 2018 17:14:52 +0000 (19:14 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 16 Apr 2018 12:21:05 +0000 (14:21 +0200)
To handle the source color image transitions in the same place.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Niuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_resolve.c

index 1828eb37f46ebc3765dd43773c50475aa9d4f2bf..d66f1c9f933c590954827c9bb9193c0eb37ac46b 100644 (file)
@@ -689,18 +689,15 @@ radv_decompress_resolve_subpass_src(struct radv_cmd_buffer *cmd_buffer)
                    dest_att.attachment == VK_ATTACHMENT_UNUSED)
                        continue;
 
-               struct radv_image_view *src_iview =
-                       fb->attachments[src_att.attachment].attachment;
+               struct radv_image *src_image =
+                       fb->attachments[src_att.attachment].attachment->image;
 
-               VkImageSubresourceRange range;
-               range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
-               range.baseMipLevel = 0;
-               range.levelCount = 1;
-               range.baseArrayLayer = 0;
-               range.layerCount = 1;
+               VkImageResolve region = {};
+               region.srcSubresource.baseArrayLayer = 0;
+               region.srcSubresource.mipLevel = 0;
+               region.srcSubresource.layerCount = 1;
 
-               radv_fast_clear_flush_image_inplace(cmd_buffer,
-                                                   src_iview->image, &range);
+               radv_decompress_resolve_src(cmd_buffer, src_image, 1, &region);
        }
 }