Merge pull request #7626 from sum2012/GPU-minor

GPU:Avoid "decimate" the usageFlags corrupted memory
This commit is contained in:
Henrik Rydgård 2015-03-23 15:22:08 +01:00
commit 79fc557ad1
2 changed files with 7 additions and 6 deletions

View File

@ -1150,6 +1150,10 @@ namespace DX9 {
ReadFramebufferToMemory(vfb, false, 0, 0, vfb->width, vfb->height);
}
// Let's also "decimate" the usageFlags.
UpdateFramebufUsage(vfb);
if (vfb != displayFramebuf_ && vfb != prevDisplayFramebuf_ && vfb != prevPrevDisplayFramebuf_) {
if (age > FBO_OLD_AGE) {
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age);
@ -1157,9 +1161,6 @@ namespace DX9 {
vfbs_.erase(vfbs_.begin() + i--);
}
}
// Let's also "decimate" the usageFlags.
UpdateFramebufUsage(vfb);
}
for (auto it = tempFBOs_.begin(); it != tempFBOs_.end(); ) {

View File

@ -1854,6 +1854,9 @@ void FramebufferManager::DecimateFBOs() {
ReadFramebufferToMemory(vfb, sync, 0, 0, vfb->width, vfb->height);
}
// Let's also "decimate" the usageFlags.
UpdateFramebufUsage(vfb);
if (vfb != displayFramebuf_ && vfb != prevDisplayFramebuf_ && vfb != prevPrevDisplayFramebuf_) {
if (age > FBO_OLD_AGE) {
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age);
@ -1861,9 +1864,6 @@ void FramebufferManager::DecimateFBOs() {
vfbs_.erase(vfbs_.begin() + i--);
}
}
// Let's also "decimate" the usageFlags.
UpdateFramebufUsage(vfb);
}
for (auto it = tempFBOs_.begin(); it != tempFBOs_.end(); ) {