mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix a crash where we used an old framebuf.
This was causing Breath of Fire 3 to crash, because it had an offset framebuffer set that was never detatched.
This commit is contained in:
parent
f31fbb9417
commit
7d5f308494
1 changed files with 10 additions and 10 deletions
|
@ -178,16 +178,16 @@ void TextureCacheCommon::NotifyFramebuffer(u32 address, VirtualFramebuffer *fram
|
|||
break;
|
||||
|
||||
case NOTIFY_FB_DESTROYED:
|
||||
fbCache_.erase(std::remove(fbCache_.begin(), fbCache_.end(), framebuffer), fbCache_.end());
|
||||
for (auto it = cache.lower_bound(cacheKey), end = cache.upper_bound(cacheKeyEnd); it != end; ++it) {
|
||||
DetachFramebuffer(&it->second, addr, framebuffer);
|
||||
}
|
||||
for (auto it = cache.lower_bound(mirrorCacheKey), end = cache.upper_bound(mirrorCacheKeyEnd); it != end; ++it) {
|
||||
const u64 mirrorlessKey = it->first & ~0x0060000000000000ULL;
|
||||
// Let's still make sure it's in the cache range.
|
||||
if (mirrorlessKey >= cacheKey && mirrorlessKey <= cacheKeyEnd) {
|
||||
DetachFramebuffer(&it->second, addr, framebuffer);
|
||||
}
|
||||
fbCache_.erase(std::remove(fbCache_.begin(), fbCache_.end(), framebuffer), fbCache_.end());
|
||||
|
||||
// We may have an offset texture attached. So we use fbTexInfo as a guide.
|
||||
// We're not likely to have many attached framebuffers.
|
||||
for (auto it = fbTexInfo_.begin(); it != fbTexInfo_.end(); ) {
|
||||
u64 cachekey = it->first;
|
||||
// We might erase, so move to the next one already (which won't become invalid.)
|
||||
++it;
|
||||
|
||||
DetachFramebuffer(&cache[cachekey], addr, framebuffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue