From 9b5499caf2ccd4789fcdd781686d99cc5fdcb776 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 7 Feb 2025 22:49:19 +0100 Subject: [PATCH] [dxvk] Ignore deferred discards that we can't fold into load ops --- src/dxvk/dxvk_context.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 3e24915ce..683fc7373 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1912,6 +1912,11 @@ namespace dxvk { attachmentIndex = -1; } + // Completely ignore pure discards here if we can't fold them into the next + // render pass, since all we'd do is add an extra barrier for no reason. + if (attachmentIndex < 0 && !clearAspects) + return; + bool is3D = imageView->image()->info().type == VK_IMAGE_TYPE_3D; if ((clearAspects | discardAspects) == imageView->info().aspects && !is3D) { @@ -1995,7 +2000,7 @@ namespace dxvk { m_cmd->cmdBeginRendering(&renderingInfo); - if (useLateClear && clearAspects) { + if (useLateClear) { VkClearAttachment clearInfo = { }; clearInfo.aspectMask = clearAspects; clearInfo.clearValue = clearValue;