From: Jesse Natalie Date: Thu, 30 Mar 2023 20:39:41 +0000 (-0700) Subject: dzn: Attempt to force depth write states for depth access in LAYOUT_GENERIC X-Git-Tag: upstream/23.3.3~10373 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=023f7b26dc535f33ac23d6dc55044ddda2202a66;p=platform%2Fupstream%2Fmesa.git dzn: Attempt to force depth write states for depth access in LAYOUT_GENERIC Part-of: --- diff --git a/src/microsoft/vulkan/dzn_cmd_buffer.c b/src/microsoft/vulkan/dzn_cmd_buffer.c index 01b24dd..1e5324f 100644 --- a/src/microsoft/vulkan/dzn_cmd_buffer.c +++ b/src/microsoft/vulkan/dzn_cmd_buffer.c @@ -1150,9 +1150,19 @@ dzn_CmdPipelineBarrier2(VkCommandBuffer commandBuffer, ID3D12GraphicsCommandList1_ResourceBarrier(cmdbuf->cmdlist, 1, &aliasing_barrier); } + VkImageLayout old_layout = ibarrier->oldLayout; + VkImageLayout new_layout = ibarrier->newLayout; + if ((image->vk.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) && + old_layout == VK_IMAGE_LAYOUT_GENERAL && + (ibarrier->srcAccessMask & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT)) + old_layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + if ((image->vk.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) && + new_layout == VK_IMAGE_LAYOUT_GENERAL && + (ibarrier->dstAccessMask & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT)) + new_layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; dzn_cmd_buffer_queue_image_range_layout_transition(cmdbuf, image, range, - ibarrier->oldLayout, - ibarrier->newLayout, + old_layout, + new_layout, DZN_QUEUE_TRANSITION_FLUSH); } }