mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-16 12:58:33 +02:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user