1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix Texture Cache slow down and crashes

This commit is contained in:
orbea 2016-09-15 15:44:55 -07:00
parent 04a1faa689
commit f7576185cc

View File

@ -526,12 +526,14 @@ void TextureCache::_checkCacheSize()
#ifdef VC
const size_t maxCacheSize = 15000;
#else
const size_t maxCacheSize = 128000;
const size_t maxCacheSize = 16384;
#endif
// Clear cache if its size is too large.
if (m_textures.size() >= maxCacheSize) {
_clear();
return;
CachedTexture& clsTex = m_textures.back();
m_cachedBytes -= clsTex.textureBytes;
glDeleteTextures(1, &clsTex.glName);
m_lruTextureLocations.erase(clsTex.crc);
m_textures.pop_back();
}
if (m_cachedBytes <= m_maxBytes)