From 12ad2b05ef3844e5da82a2d74efcfa00b8bdf311 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 17 Oct 2021 21:53:23 -0700 Subject: [PATCH] GPU: Blit framebuf depth on create too. Before we only did it for an existing target framebuffer, and never for a fresh one. But there's not really a good reason to skip that, and this may improve effects that are cemented after a single frame. --- GPU/Common/FramebufferManagerCommon.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 4da29c10a3..90b19fe286 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -375,6 +375,11 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame ResizeFramebufFBO(vfb, drawing_width, drawing_height, true); NotifyRenderFramebufferCreated(vfb); + // We might already want to copy depth, in case this is a temp buffer. See #7810. + if (currentRenderVfb_ && !params.isClearingDepth) { + BlitFramebufferDepth(currentRenderVfb_, vfb); + } + SetColorUpdated(vfb, skipDrawReason); INFO_LOG(FRAMEBUF, "Creating FBO for %08x (z: %08x) : %i x %i x %i", vfb->fb_address, vfb->z_address, vfb->width, vfb->height, vfb->format); @@ -387,7 +392,7 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame if (useBufferedRendering_ && !g_Config.bDisableSlowFramebufEffects) { gpu->PerformMemoryUpload(params.fb_address, byteSize); NotifyStencilUpload(params.fb_address, byteSize, StencilUpload::STENCIL_IS_ZERO); - // TODO: Is it worth trying to upload the depth buffer? + // TODO: Is it worth trying to upload the depth buffer (only if it wasn't copied above..?) } // Let's check for depth buffer overlap. Might be interesting.