From 21e917341589249a4220913608514a60592d47c7 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 23 Jan 2018 13:27:41 +0100 Subject: [PATCH] [dxvk] Use VK_IMAGE_LAYOUT_GENERAL for all render targets This is a workaround for rendering issues in some games where render targets get seemingly randomly cleared for unknown reasons. Fixes Homefront. --- src/dxvk/dxvk_renderpass.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dxvk/dxvk_renderpass.cpp b/src/dxvk/dxvk_renderpass.cpp index be2a4453..3ce202b3 100644 --- a/src/dxvk/dxvk_renderpass.cpp +++ b/src/dxvk/dxvk_renderpass.cpp @@ -78,8 +78,10 @@ namespace dxvk { desc.initialLayout = depthFmt.initialLayout; desc.finalLayout = depthFmt.finalLayout; + // TODO Using GENERAL is a workaround for bugs in either dxvk or + // RADV. Revert to VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL. depthRef.attachment = attachments.size(); - depthRef.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + depthRef.layout = VK_IMAGE_LAYOUT_GENERAL; attachments.push_back(desc); } @@ -102,8 +104,10 @@ namespace dxvk { desc.initialLayout = colorFmt.initialLayout; desc.finalLayout = colorFmt.finalLayout; + // TODO Using GENERAL is a workaround for bugs in either dxvk + // or RADV. Revert to VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL. colorRef[i].attachment = attachments.size(); - colorRef[i].layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; + colorRef[i].layout = VK_IMAGE_LAYOUT_GENERAL; attachments.push_back(desc); }