From 769d6ba2009a366e0e49f399497a59876dd89286 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 6 Jan 2020 11:28:59 -0600 Subject: [PATCH] anv: Use TRANSFER_SRC_OPTIMAL for depth/stencil MSAA resolves As of 52ad1712ed62, TRANSFER_SRC_OPTIMAL and SHADER_READ_ONLY_OPTIMAL are now identical for depth buffers so there's no reason why we need to use the "wrong" layout. Technically, according to Vulkan, blits and MSAA resolves are transfer ops so we should use the transfer layout now that we can. Reviewed-by: Lionel Landwerlin Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index edde918dc6b..0db58bc3bd5 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -5026,12 +5026,12 @@ cmd_buffer_end_subpass(struct anv_cmd_buffer *cmd_buffer) */ transition_depth_buffer(cmd_buffer, src_iview->image, src_state->current_layout, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); src_state->aux_usage = anv_layout_to_aux_usage(&cmd_buffer->device->info, src_iview->image, VK_IMAGE_ASPECT_DEPTH_BIT, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); - src_state->current_layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); + src_state->current_layout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; /* MSAA resolves write to the resolve attachment as if it were any * other transfer op. Transition the resolve attachment accordingly. @@ -5078,7 +5078,7 @@ cmd_buffer_end_subpass(struct anv_cmd_buffer *cmd_buffer) if ((src_iview->image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) && subpass->stencil_resolve_mode != VK_RESOLVE_MODE_NONE_KHR) { - src_state->current_stencil_layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + src_state->current_stencil_layout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; dst_state->current_stencil_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; enum isl_aux_usage src_aux_usage = ISL_AUX_USAGE_NONE; -- 2.30.2