diff options
| author | Markus Wick <markus@selfnet.de> | 2015-06-09 10:12:05 +0200 |
|---|---|---|
| committer | Markus Wick <markus@selfnet.de> | 2015-06-09 10:12:05 +0200 |
| commit | e47e4c677ad22895f8c8bc78676dd295e36f2695 (patch) | |
| tree | 37d306e148e742956e7191c1912dd8083eb95fe7 /Source/Core/VideoCommon/TextureCacheBase.h | |
| parent | 0047ea88524eeadc9eda366e9270decdb1ca43fe (diff) | |
| parent | 3b9020dc9bd164f53a022a276a3369f3e5a97135 (diff) | |
Merge pull request #2097 from mimimi085181/find-textures-by-hash
Search the texture cache for small textures by address and hash
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.h')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index 7cc5d1e875..37bbe2764e 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -60,6 +60,8 @@ public: // used to delete textures which haven't been used for TEXTURE_KILL_THRESHOLD frames int frameCount; + // Keep an iterator to the entry in textures_by_hash, so it does not need to be searched when removing the cache entry + std::multimap<u64, TCacheEntryBase*>::iterator textures_by_hash_iter; void SetGeneralParameters(u32 _addr, u32 _size, u32 _format) { @@ -131,18 +133,20 @@ protected: static size_t temp_size; private: + typedef std::multimap<u64, TCacheEntryBase*> TexCache; + typedef std::unordered_multimap<TCacheEntryConfig, TCacheEntryBase*, TCacheEntryConfig::Hasher> TexPool; + static void DumpTexture(TCacheEntryBase* entry, std::string basename, unsigned int level); static void CheckTempSize(size_t required_size); static TCacheEntryBase* AllocateTexture(const TCacheEntryConfig& config); + static TexCache::iterator RemoveTextureFromCache(TexCache::iterator t_iter); static void FreeTexture(TCacheEntryBase* entry); static TCacheEntryBase* ReturnEntry(unsigned int stage, TCacheEntryBase* entry); - typedef std::multimap<u32, TCacheEntryBase*> TexCache; - typedef std::unordered_multimap<TCacheEntryConfig, TCacheEntryBase*, TCacheEntryConfig::Hasher> TexPool; - - static TexCache textures; + static TexCache textures_by_address; + static TexCache textures_by_hash; static TexPool texture_pool; static TCacheEntryBase* bound_textures[8]; |
