From 35777d5eef6ad49e238d997261f78200151deb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 2 Dec 2022 15:26:29 +0100 Subject: [PATCH] Use proper copies for depth blits between multisampled framebuffers. Needed to keep all the information. --- GPU/Common/FramebufferManagerCommon.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 175d36d0bc..5bf2cdc9de 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -947,6 +947,14 @@ void FramebufferManagerCommon::BlitFramebufferDepth(VirtualFramebuffer *src, Vir bool useRaster = draw_->GetDeviceCaps().fragmentShaderDepthWriteSupported && draw_->GetDeviceCaps().textureDepthSupported; + if (src->fbo->MultiSampleLevel() > 0 && dst->fbo->MultiSampleLevel() > 0) { + // If multisampling, we want to copy depth properly so we get all the samples, to avoid aliased edges. + // Can be seen in the fire in Jeanne D'arc, for example. + if (useRaster && useCopy) { + useRaster = false; + } + } + int w = std::min(src->renderWidth, dst->renderWidth); int h = std::min(src->renderHeight, dst->renderHeight);