Decimate temporary FBOs after not being used.

This commit is contained in:
Unknown W. Brackets 2014-05-31 22:42:09 -07:00
parent 0846673dc3
commit 3e8442c371

View File

@ -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];