From 3e8442c37134b4dd97b84d4e38a475dd3f8e8364 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 31 May 2014 22:42:09 -0700 Subject: [PATCH] Decimate temporary FBOs after not being used. --- GPU/GLES/Framebuffer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 18f00cfd3..5e597db8e 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1771,6 +1771,16 @@ void FramebufferManager::DecimateFBOs() { } } + for (auto it = tempFBOs_.begin(); it != tempFBOs_.end(); ) { + int age = frameLastFramebufUsed - it->second.last_frame_used; + if (age > FBO_OLD_AGE) { + fbo_destroy(it->second.fbo); + tempFBOs_.erase(it++); + } else { + ++it; + } + } + // Do the same for ReadFramebuffersToMemory's VFBs for (size_t i = 0; i < bvfbs_.size(); ++i) { VirtualFramebuffer *vfb = bvfbs_[i];