From 11501216064497a34b4a89a818f4267d17921ab2 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 19 Mar 2020 15:56:12 +0100 Subject: [PATCH] [d3d9] Fix depth-stencil layouts Otherwise we're always using GENERAL for depth buffers. --- src/d3d9/d3d9_common_texture.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/d3d9/d3d9_common_texture.h b/src/d3d9/d3d9_common_texture.h index 4df0c9c6..0bc47d51 100644 --- a/src/d3d9/d3d9_common_texture.h +++ b/src/d3d9/d3d9_common_texture.h @@ -325,12 +325,11 @@ namespace dxvk { } VkImageLayout DetermineDepthStencilLayout(bool hazardous) const { - VkImageLayout layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + VkImageLayout layout = hazardous + ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL + : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; - if (unlikely(hazardous)) - layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL; - - if (unlikely(m_image->info().tiling == VK_IMAGE_TILING_OPTIMAL)) + if (unlikely(m_image->info().tiling != VK_IMAGE_TILING_OPTIMAL)) layout = VK_IMAGE_LAYOUT_GENERAL; return layout;