mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Fix Texture Cache slow down and crashes
This commit is contained in:
parent
04a1faa689
commit
f7576185cc
|
@ -526,12 +526,14 @@ void TextureCache::_checkCacheSize()
|
||||||
#ifdef VC
|
#ifdef VC
|
||||||
const size_t maxCacheSize = 15000;
|
const size_t maxCacheSize = 15000;
|
||||||
#else
|
#else
|
||||||
const size_t maxCacheSize = 128000;
|
const size_t maxCacheSize = 16384;
|
||||||
#endif
|
#endif
|
||||||
// Clear cache if its size is too large.
|
|
||||||
if (m_textures.size() >= maxCacheSize) {
|
if (m_textures.size() >= maxCacheSize) {
|
||||||
_clear();
|
CachedTexture& clsTex = m_textures.back();
|
||||||
return;
|
m_cachedBytes -= clsTex.textureBytes;
|
||||||
|
glDeleteTextures(1, &clsTex.glName);
|
||||||
|
m_lruTextureLocations.erase(clsTex.crc);
|
||||||
|
m_textures.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_cachedBytes <= m_maxBytes)
|
if (m_cachedBytes <= m_maxBytes)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user