mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Invalidate the texcache without restarting loop.
This commit is contained in:
parent
063f914ff3
commit
8e09869ac2
1 changed files with 7 additions and 5 deletions
|
@ -84,16 +84,18 @@ void TextureCache_Clear(bool delete_them)
|
|||
// Removes old textures.
|
||||
void TextureCache_Decimate()
|
||||
{
|
||||
// TODO: Need a better way to keep looping
|
||||
restart:
|
||||
for (TexCache::iterator iter = cache.begin(); iter != cache.end(); ++iter)
|
||||
for (TexCache::iterator iter = cache.begin(); iter != cache.end(); )
|
||||
{
|
||||
if (iter->second.frameCounter + TEXTURE_KILL_AGE < gpuStats.numFrames)
|
||||
{
|
||||
TexCacheEntry &entry = iter->second;
|
||||
NOTICE_LOG(G3D, "Deleted texture %i from %08x: fmt: %i", entry.texture, entry.addr, entry.format);
|
||||
|
||||
glDeleteTextures(1, &iter->second.texture);
|
||||
cache.erase(iter);
|
||||
goto restart;
|
||||
cache.erase(iter++);
|
||||
}
|
||||
else
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue