Render: Implemented simple render target pool

This avoids creating and destroying render targets every frame,
which is a significant CPU overhead.

Old render targets are destroyed after 3 frames.
This commit is contained in:
Yuriy O'Donnell
2014-06-12 01:04:42 +02:00
parent 830a03c540
commit d8d9bc8c6c
2 changed files with 64 additions and 3 deletions

View File

@ -119,9 +119,14 @@ private:
static PC_TexFormat LoadCustomTexture(u64 tex_hash, int texformat, unsigned int level, unsigned int& width, unsigned int& height);
static void DumpTexture(TCacheEntryBase* entry, unsigned int level);
static TCacheEntryBase* AllocateRenderTarget(unsigned int width, unsigned int height);
static void FreeRenderTarget(TCacheEntryBase* entry);
typedef std::map<u32, TCacheEntryBase*> TexCache;
typedef std::vector<TCacheEntryBase*> RenderTargetPool;
static TexCache textures;
static RenderTargetPool render_target_pool;
// Backup configuration values
static struct BackupConfig