1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +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:
Logan McNaughton 2016-06-06 22:58:09 -06:00 committed by Sergey Lipskiy
parent c9615e9164
commit 8c632ca0ad

View File

@ -522,6 +522,16 @@ void TextureCache::destroy()
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)
return;