diff options
| author | Markus Wick <markus+github@selfnet.de> | 2015-01-11 01:01:18 +0100 |
|---|---|---|
| committer | Markus Wick <markus+github@selfnet.de> | 2015-01-11 01:01:18 +0100 |
| commit | 6c46f27709f314f2552d2ed6316ae79ed8d0c692 (patch) | |
| tree | 7da54376d616cc5f6a089b02aef657402c4104bf /Source/Core/VideoCommon | |
| parent | 5dd93fd62b491b2d6752645c8adb5ce8948c44f7 (diff) | |
| parent | 38f42da55aa49d438fda123ccd7c7126e23714f4 (diff) | |
Merge pull request #1501 from degasus/texture_creation
D3D: remove load texture on creation optimization
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.h | 6 |
2 files changed, 6 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 143a26cbd1..ce9b724b8f 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -466,7 +466,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage, // create the entry/texture if (nullptr == entry) { - textures[texID] = entry = g_texture_cache->CreateTexture(width, height, expandedWidth, texLevels, pcfmt); + textures[texID] = entry = g_texture_cache->CreateTexture(width, height, texLevels, pcfmt); // Sometimes, we can get around recreating a texture if only the number of mip levels changes // e.g. if our texture cache entry got too many mipmap levels we can limit the number of used levels by setting the appropriate render states @@ -481,16 +481,14 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage, GFX_DEBUGGER_PAUSE_AT(NEXT_NEW_TEXTURE, true); } - else - { - // load texture (CreateTexture also loads level 0) - entry->Load(width, height, expandedWidth, 0); - } entry->SetGeneralParameters(address, texture_size, full_format, entry->num_mipmaps, entry->num_layers); entry->SetDimensions(nativeW, nativeH, width, height); entry->hash = tex_hash; + // load texture + entry->Load(width, height, expandedWidth, 0); + if (entry->IsEfbCopy() && !g_ActiveConfig.bCopyEFBToTexture) entry->type = TCET_EC_DYNAMIC; else diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index e3eb6a00fa..0b8cf48918 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -33,7 +33,6 @@ public: u32 addr; u32 size_in_bytes; u64 hash; - //u32 pal_hash; u32 format; enum TexCacheEntryType type; @@ -64,10 +63,9 @@ public: virtual_height = _virtual_height; } - void SetHashes(u64 _hash/*, u32 _pal_hash*/) + void SetHashes(u64 _hash) { hash = _hash; - //pal_hash = _pal_hash; } @@ -100,7 +98,7 @@ public: static bool Find(u32 start_address, u64 hash); virtual TCacheEntryBase* CreateTexture(unsigned int width, unsigned int height, - unsigned int expanded_width, unsigned int tex_levels, PC_TexFormat pcfmt) = 0; + unsigned int tex_levels, PC_TexFormat pcfmt) = 0; virtual TCacheEntryBase* CreateRenderTargetTexture(unsigned int scaled_tex_w, unsigned int scaled_tex_h) = 0; virtual void CompileShaders() = 0; // currently only implemented by OGL |
