mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Restore the clearing optimization, avoiding unnecessary depth copies
This commit is contained in:
parent
12db0e52d4
commit
29ea3ffe0c
@ -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();
|
||||
|
@ -267,7 +267,7 @@ public:
|
||||
return vfb;
|
||||
}
|
||||
}
|
||||
void SetDepthFrameBuffer();
|
||||
void SetDepthFrameBuffer(bool isClearingDepth);
|
||||
|
||||
void RebindFramebuffer(const char *tag);
|
||||
std::vector<FramebufferInfo> GetFramebufferList() const;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user