From 6c32d5cd8fff7e38d89ae47419a065a1fa174543 Mon Sep 17 00:00:00 2001 From: Logan McNaughton Date: Tue, 4 Apr 2017 08:58:49 -0700 Subject: [PATCH] Texture Cache performance improvements --- src/Textures.cpp | 6 +----- src/Textures.h | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Textures.cpp b/src/Textures.cpp index 91dc9e83..c7fb254f 100644 --- a/src/Textures.cpp +++ b/src/Textures.cpp @@ -551,11 +551,7 @@ void TextureCache::destroy() void TextureCache::_checkCacheSize() { -#ifdef VC - const size_t maxCacheSize = 15000; -#else - const size_t maxCacheSize = 16384; -#endif + const size_t maxCacheSize = 8000; if (m_textures.size() >= maxCacheSize) { CachedTexture& clsTex = m_textures.back(); m_cachedBytes -= clsTex.textureBytes; diff --git a/src/Textures.h b/src/Textures.h index 8849d118..44659434 100644 --- a/src/Textures.h +++ b/src/Textures.h @@ -2,6 +2,7 @@ #define TEXTURES_H #include +#include #include #include "CRC.h" @@ -84,7 +85,7 @@ private: void _getTextureDestData(CachedTexture& tmptex, u32* pDest, graphics::Parameter glInternalFormat, GetTexelFunc GetTexel, u16* pLine); typedef std::list Textures; - typedef std::map Texture_Locations; + typedef std::unordered_map Texture_Locations; typedef std::map FBTextures; Textures m_textures; Texture_Locations m_lruTextureLocations;