From df76a5252a79ba5c02eb32b8e018b4831a1451aa Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 15 Feb 2021 15:42:52 +0100 Subject: [PATCH] [dxvk] Use default layout for depth-stencil image descriptors Apparently the image layout matching rules were relaxed at some point, so just using DEPTH_STENCIL_READ_ONLY_OPTIMAL for descriptors is legal even if the image is in DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL or DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL in the current render pass. --- src/dxvk/dxvk_context.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 6baa2ad8..e3236695 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -3791,20 +3791,6 @@ namespace dxvk { DxvkBindingMask bindMask; bindMask.setFirst(layout->bindingCount()); - // If the depth attachment is also bound as a shader - // resource, we have to use the appropriate layout - VkImage depthImage = VK_NULL_HANDLE; - VkImageLayout depthLayout = VK_IMAGE_LAYOUT_UNDEFINED; - - if (BindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS) { - const auto& depthAttachment = m_state.om.framebuffer->getDepthTarget(); - - if (depthAttachment.view != nullptr) { - depthImage = depthAttachment.view->imageHandle(); - depthLayout = depthAttachment.layout; - } - } - for (uint32_t i = 0; i < layout->bindingCount(); i++) { const auto& binding = layout->binding(i); const auto& res = m_rc[binding.slot]; @@ -3828,9 +3814,6 @@ namespace dxvk { descriptors[i].image.imageView = res.imageView->handle(binding.view); descriptors[i].image.imageLayout = res.imageView->imageInfo().layout; - if (unlikely(res.imageView->imageHandle() == depthImage)) - descriptors[i].image.imageLayout = depthLayout; - if (m_rcTracked.set(binding.slot)) { m_cmd->trackResource(res.imageView); m_cmd->trackResource(res.imageView->image()); @@ -3846,9 +3829,6 @@ namespace dxvk { descriptors[i].image.imageView = res.imageView->handle(binding.view); descriptors[i].image.imageLayout = res.imageView->imageInfo().layout; - if (unlikely(res.imageView->imageHandle() == depthImage)) - descriptors[i].image.imageLayout = depthLayout; - if (m_rcTracked.set(binding.slot)) { m_cmd->trackResource(res.imageView); m_cmd->trackResource(res.imageView->image()); @@ -3865,9 +3845,6 @@ namespace dxvk { descriptors[i].image.imageView = res.imageView->handle(binding.view); descriptors[i].image.imageLayout = res.imageView->imageInfo().layout; - if (unlikely(res.imageView->imageHandle() == depthImage)) - descriptors[i].image.imageLayout = depthLayout; - if (m_rcTracked.set(binding.slot)) { m_cmd->trackResource(res.sampler); m_cmd->trackResource(res.imageView);