GS/TextureCache: Don't let hash cache memusage go negative

This commit is contained in:
Connor McLaughlin 2022-03-01 17:26:16 +10:00 committed by refractionpcsx2
parent 11918e5846
commit 0c98b5ff76
1 changed files with 3 additions and 1 deletions

View File

@ -1138,7 +1138,9 @@ void GSTextureCache::IncAge()
HashCacheEntry& e = it->second;
if (e.refcount == 0 && ++e.age > max_hash_cache_age)
{
if (!e.is_replacement)
m_hash_cache_memory_usage -= e.texture->GetMemUsage();
g_gs_device->Recycle(e.texture);
m_hash_cache.erase(it++);
}