diff options
author | Samuel Pitoiset <[email protected]> | 2019-05-28 11:03:29 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-05-29 08:53:48 +0200 |
commit | d3771ccaa347a4208807bd30a5366177d3c3aa1d (patch) | |
tree | c1520e9e588bb045b63c30d58ff43e6f7c43dab2 /src/amd/vulkan | |
parent | 017170a7859ab1a5c82e8cb5991b2bbb83d70c10 (diff) |
radv: use view format when selecting the resolve path for subpasses
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c index b4551a98637..2b97c42fc69 100644 --- a/src/amd/vulkan/radv_meta_resolve.c +++ b/src/amd/vulkan/radv_meta_resolve.c @@ -331,6 +331,7 @@ enum radv_resolve_method { }; static void radv_pick_resolve_method_images(struct radv_image *src_image, + VkFormat src_format, struct radv_image *dest_image, VkImageLayout dest_image_layout, struct radv_cmd_buffer *cmd_buffer, @@ -341,10 +342,10 @@ static void radv_pick_resolve_method_images(struct radv_image *src_image, cmd_buffer->queue_family_index, cmd_buffer->queue_family_index); - if (src_image->vk_format == VK_FORMAT_R16G16_UNORM || - src_image->vk_format == VK_FORMAT_R16G16_SNORM) + if (src_format == VK_FORMAT_R16G16_UNORM || + src_format == VK_FORMAT_R16G16_SNORM) *method = RESOLVE_COMPUTE; - else if (vk_format_is_int(src_image->vk_format)) + else if (vk_format_is_int(src_format)) *method = RESOLVE_COMPUTE; else if (src_image->info.array_size > 1 || dest_image->info.array_size > 1) @@ -422,9 +423,9 @@ void radv_CmdResolveImage( } else resolve_method = RESOLVE_COMPUTE; - radv_pick_resolve_method_images(src_image, dest_image, - dest_image_layout, cmd_buffer, - &resolve_method); + radv_pick_resolve_method_images(src_image, src_image->vk_format, + dest_image, dest_image_layout, + cmd_buffer, &resolve_method); if (resolve_method == RESOLVE_FRAGMENT) { radv_meta_resolve_fragment_image(cmd_buffer, @@ -634,9 +635,13 @@ radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer) cmd_buffer->state.attachments[dest_att.attachment].pending_clear_aspects = 0; struct radv_image *dst_img = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment->image; - struct radv_image *src_img = cmd_buffer->state.framebuffer->attachments[src_att.attachment].attachment->image; + struct radv_image_view *src_iview= cmd_buffer->state.framebuffer->attachments[src_att.attachment].attachment; + struct radv_image *src_img = src_iview->image; + + radv_pick_resolve_method_images(src_img, src_iview->vk_format, + dst_img, dest_att.layout, + cmd_buffer, &resolve_method); - radv_pick_resolve_method_images(src_img, dst_img, dest_att.layout, cmd_buffer, &resolve_method); if (resolve_method == RESOLVE_FRAGMENT) { break; } |