mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Clear cache if its size is too large.
This commit is contained in:
parent
006218c708
commit
803eb1d381
|
@ -524,14 +524,15 @@ void TextureCache::destroy()
|
||||||
void TextureCache::_checkCacheSize()
|
void TextureCache::_checkCacheSize()
|
||||||
{
|
{
|
||||||
#ifdef VC
|
#ifdef VC
|
||||||
if (m_textures.size() > 15000) {
|
const size_t maxCacheSize = 15000;
|
||||||
CachedTexture& piTex = m_textures.back();
|
#else
|
||||||
m_cachedBytes -= piTex.textureBytes;
|
const size_t maxCacheSize = 128000;
|
||||||
glDeleteTextures(1, &piTex.glName);
|
|
||||||
m_lruTextureLocations.erase(piTex.crc);
|
|
||||||
m_textures.pop_back();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
// Clear cache if its size is too large.
|
||||||
|
if (m_textures.size() >= maxCacheSize) {
|
||||||
|
_clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_cachedBytes <= m_maxBytes)
|
if (m_cachedBytes <= m_maxBytes)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user