From 86bbb447d3d9b41b26e9a7caf9fe2d75f92ea940 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 19 May 2020 22:14:47 -0700 Subject: [PATCH] Vulkan: Avoid stencilAction != depthAction. This is the only place we do it, and apparently there can be bugs on some drivers when you do that. Let's not. --- GPU/Vulkan/StencilBufferVulkan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Vulkan/StencilBufferVulkan.cpp b/GPU/Vulkan/StencilBufferVulkan.cpp index 8b8b21090f..ec39e42c5b 100644 --- a/GPU/Vulkan/StencilBufferVulkan.cpp +++ b/GPU/Vulkan/StencilBufferVulkan.cpp @@ -171,9 +171,9 @@ bool FramebufferManagerVulkan::NotifyStencilUpload(u32 addr, int size, StencilUp return false; if (dstBuffer->fbo) { + // Use keep because some drivers have trouble when stencilAction != depthAction. // Typically, STENCIL_IS_ZERO means it's already bound, so this bind will be optimized away. - Draw::RPAction stencilAction = flags == StencilUpload::STENCIL_IS_ZERO ? Draw::RPAction::KEEP : Draw::RPAction::CLEAR; - draw_->BindFramebufferAsRenderTarget(dstBuffer->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, stencilAction }); + draw_->BindFramebufferAsRenderTarget(dstBuffer->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }); } else { // something is wrong... }