From 35157357dddd3c644fbed53523d54c87ccc81c20 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 19 Apr 2024 01:43:23 +0200 Subject: [PATCH] [dxvk] Fix stencil discard being broken --- src/dxvk/dxvk_context.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index dcaa7cb7..d24d919b 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1997,7 +1997,7 @@ namespace dxvk { depthOp.loadOpS = VK_ATTACHMENT_LOAD_OP_LOAD; depthOp.loadLayout = imageView->imageInfo().layout; depthOp.storeLayout = imageView->imageInfo().layout; - + if (clearAspects & VK_IMAGE_ASPECT_COLOR_BIT) colorOp.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; else if (discardAspects & VK_IMAGE_ASPECT_COLOR_BIT) @@ -2010,7 +2010,7 @@ namespace dxvk { if (clearAspects & VK_IMAGE_ASPECT_STENCIL_BIT) depthOp.loadOpS = VK_ATTACHMENT_LOAD_OP_CLEAR; - else if (discardAspects & VK_IMAGE_ASPECT_DEPTH_BIT) + else if (discardAspects & VK_IMAGE_ASPECT_STENCIL_BIT) depthOp.loadOpS = VK_ATTACHMENT_LOAD_OP_DONT_CARE; if (attachmentIndex >= 0 && !m_state.om.framebufferInfo.isWritable(attachmentIndex, clearAspects | discardAspects)) {