From 8f26b6cd3e96cb1fb5d7bcccd70ea756971fe2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 2 Aug 2022 00:31:20 +0200 Subject: [PATCH] Unsuccessful attempt at fixing Colin McRae --- GPU/Common/FramebufferManagerCommon.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 6bd691cfcee9..f579714a1a11 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -420,8 +420,6 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame // None found? Create one. if (!vfb) { - gstate_c.usingDepth = false; // reset depth buffer tracking - vfb = new VirtualFramebuffer{}; vfb->fbo = nullptr; vfb->fb_address = params.fb_address; @@ -463,6 +461,12 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame // TODO: Is it worth trying to upload the depth buffer (only if it wasn't copied above..?) } + // We don't try to optimize depth buffer tracking on the frame a framebuffer is created. + // See #7810 + gstate_c.usingDepth = true; + gstate_c.clearingDepth = false; + SetDepthFrameBuffer(); + // Let's check for depth buffer overlap. Might be interesting. bool sharingReported = false; for (size_t i = 0, end = vfbs_.size(); i < end; ++i) {