diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 7c2159146c..308f1b7fd5 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -497,13 +497,16 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame } // Called on the first use of depth in a render pass. -void FramebufferManagerCommon::SetDepthFrameBuffer() { +void FramebufferManagerCommon::SetDepthFrameBuffer(bool isClearingDepth) { if (!currentRenderVfb_) { return; } - // "Resolve" the depth buffer, by copying from any overlapping buffers with fresher content. - CopyToDepthFromOverlappingFramebuffers(currentRenderVfb_); + // If this first draw call is anything other than a clear, "resolve" the depth buffer, + // by copying from any overlapping buffers with fresher content. + if (!isClearingDepth) { + CopyToDepthFromOverlappingFramebuffers(currentRenderVfb_); + } currentRenderVfb_->usageFlags |= FB_USAGE_RENDER_DEPTH; currentRenderVfb_->depthBindSeq = GetBindSeqCount(); diff --git a/GPU/Common/FramebufferManagerCommon.h b/GPU/Common/FramebufferManagerCommon.h index 3acff211dd..447554f376 100644 --- a/GPU/Common/FramebufferManagerCommon.h +++ b/GPU/Common/FramebufferManagerCommon.h @@ -267,7 +267,7 @@ public: return vfb; } } - void SetDepthFrameBuffer(); + void SetDepthFrameBuffer(bool isClearingDepth); void RebindFramebuffer(const char *tag); std::vector GetFramebufferList() const; diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 14c4cf1f5e..7db2fd4b42 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -1635,7 +1635,7 @@ void GPUCommon::CheckDepthUsage(VirtualFramebuffer *vfb) { if (isClearingDepth || gstate.isDepthWriteEnabled()) { vfb->last_frame_depth_updated = gpuStats.numFlips; } - framebufferManager_->SetDepthFrameBuffer(); + framebufferManager_->SetDepthFrameBuffer(isClearingDepth); } } }