From 9361f19da60dde4c453e9b3b6d849d6a0af8a75a Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 26 Oct 2019 23:37:46 +0200 Subject: [PATCH] [dxvk] Fix uninitialized depth attachment reference Also don't redundantly null color attachment refs for cosmetic reasons. --- src/dxvk/dxvk_renderpass.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dxvk/dxvk_renderpass.cpp b/src/dxvk/dxvk_renderpass.cpp index fd4baa43b..60d37b8b5 100644 --- a/src/dxvk/dxvk_renderpass.cpp +++ b/src/dxvk/dxvk_renderpass.cpp @@ -82,9 +82,6 @@ namespace dxvk { // Render passes may not require the previous // contents of the attachments to be preserved. for (uint32_t i = 0; i < MaxNumRenderTargets; i++) { - colorRef[i].attachment = VK_ATTACHMENT_UNUSED; - colorRef[i].layout = VK_IMAGE_LAYOUT_UNDEFINED; - if (m_format.color[i].format != VK_FORMAT_UNDEFINED) { VkAttachmentDescription desc; desc.flags = 0; @@ -101,6 +98,9 @@ namespace dxvk { colorRef[i].layout = m_format.color[i].layout; attachments.push_back(desc); + } else { + colorRef[i].attachment = VK_ATTACHMENT_UNUSED; + colorRef[i].layout = VK_IMAGE_LAYOUT_UNDEFINED; } } @@ -120,6 +120,9 @@ namespace dxvk { depthRef.layout = m_format.depth.layout; attachments.push_back(desc); + } else { + depthRef.attachment = VK_ATTACHMENT_UNUSED; + depthRef.layout = VK_IMAGE_LAYOUT_UNDEFINED; } VkSubpassDescription subpass;