VideoCommon: create native texture pool

We often need the same native texture objects for new textures. This commit
try to avoid destroying and creation of this textures by pooling them.

This should be a big performance gain for some efb2ram games as they may
overwrites partially a cached texture (which would be deleted) and afterwards
try to read it.

Creating/destroying sounds like an easy task, but it isn't. eg the nvidia ogl
driver synchonize their threads do avoid use-after-free issues.
This commit is contained in:
degasus
2013-11-04 23:35:19 +01:00
parent f4056978c8
commit 6cece6b486
2 changed files with 86 additions and 12 deletions

View File

@ -121,8 +121,12 @@ private:
static void DumpTexture(TCacheEntryBase* entry, unsigned int level);
typedef std::map<u32, TCacheEntryBase*> TexCache;
static TexCache textures;
static TCacheEntryBase* GetPooledTexture(u32 width, u32 height, u32 full_format, u32 maxlevel, bool isEfbCopy);
static void PoolTexture(TCacheEntryBase *entry);
typedef std::multimap<std::pair<u32,u32>, TCacheEntryBase*> TexPool;
static TexPool texPool;
// Backup configuration values
static struct BackupConfig