mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Fix Texture Cache on Raspberry Pi
The Raspberry Pi only supports 32768 GPU memory allocations see https://github.com/raspberrypi/firmware/issues/611 Each texture takes 2 allocs, so the max is around 16000, I've set it to 15000 to be safe
This commit is contained in:
parent
c9615e9164
commit
8c632ca0ad
|
@ -522,6 +522,16 @@ void TextureCache::destroy()
|
||||||
|
|
||||||
void TextureCache::_checkCacheSize()
|
void TextureCache::_checkCacheSize()
|
||||||
{
|
{
|
||||||
|
#ifdef VC
|
||||||
|
if (m_textures.size() > 15000) {
|
||||||
|
CachedTexture& piTex = m_textures.back();
|
||||||
|
m_cachedBytes -= piTex.textureBytes;
|
||||||
|
glDeleteTextures(1, &piTex.glName);
|
||||||
|
m_lruTextureLocations.erase(piTex.crc);
|
||||||
|
m_textures.pop_back();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (m_cachedBytes <= m_maxBytes)
|
if (m_cachedBytes <= m_maxBytes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user