diff options
| author | Markus Wick <markus+github@selfnet.de> | 2015-01-27 09:42:15 +0100 |
|---|---|---|
| committer | Markus Wick <markus+github@selfnet.de> | 2015-01-27 09:42:15 +0100 |
| commit | 43605f87166cc4bc5e76cec016076aeb6103e24f (patch) | |
| tree | c1e741a89e03fc6b4e0256c179f69b91829e76a4 /Source/Core/VideoCommon | |
| parent | 8eda3ca844ca9b05682ec57aa3be2cbe07e19d28 (diff) | |
| parent | 6659c15bedd4add4bd536394900e74ab6b7d6648 (diff) | |
Merge pull request #1948 from magumagu/remove-efb-cache
Remove EFB to RAM cache, and simplify code.
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 28 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.h | 12 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 3 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.h | 1 |
4 files changed, 2 insertions, 42 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index ea830c24fc..b40f9d0882 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -115,12 +115,6 @@ void TextureCache::OnConfigChanged(VideoConfig& config) invalidate_texture_cache_requested = false; } - // TODO: Probably shouldn't clear all render targets here, just mark them dirty or something. - if (config.bEFBCopyCacheEnable != backup_config.s_copy_cache_enable) // TODO: not sure if this is needed? - { - g_texture_cache->ClearRenderTargets(); - } - if ((config.iStereoMode > 0) != backup_config.s_stereo_3d || config.bStereoEFBMonoDepth != backup_config.s_efb_mono_depth) { @@ -133,7 +127,6 @@ void TextureCache::OnConfigChanged(VideoConfig& config) backup_config.s_texfmt_overlay = config.bTexFmtOverlayEnable; backup_config.s_texfmt_overlay_center = config.bTexFmtOverlayCenter; backup_config.s_hires_textures = config.bHiresTextures; - backup_config.s_copy_cache_enable = config.bEFBCopyCacheEnable; backup_config.s_stereo_3d = config.iStereoMode > 0; backup_config.s_efb_mono_depth = config.bStereoEFBMonoDepth; } @@ -218,16 +211,6 @@ void TextureCache::MakeRangeDynamic(u32 start_address, u32 size) } } -bool TextureCache::Find(u32 start_address, u64 hash) -{ - TexCache::iterator iter = textures.lower_bound(start_address); - - if (iter->second->hash == hash) - return true; - - return false; -} - bool TextureCache::TCacheEntryBase::OverlapsMemoryRange(u32 range_address, u32 range_size) const { if (addr + size_in_bytes <= range_address) @@ -247,7 +230,7 @@ void TextureCache::ClearRenderTargets() while (iter != tcend) { - if (iter->second->type == TCET_EC_VRAM) + if (iter->second->IsEfbCopy()) { FreeTexture(iter->second); textures.erase(iter++); @@ -381,8 +364,6 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage) // 2. a) For EFB copies, only the hash and the texture address need to match if (entry->IsEfbCopy() && tex_hash == entry->hash && address == entry->addr) { - entry->type = TCET_EC_VRAM; - // TODO: Print a warning if the format changes! In this case, // we could reinterpret the internal texture object data to the new pixel format // (similar to what is already being done in Renderer::ReinterpretPixelFormat()) @@ -451,7 +432,6 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage) config.height = height; config.levels = texLevels; entry = AllocateTexture(config); - entry->type = TCET_NORMAL; GFX_DEBUGGER_PAUSE_AT(NEXT_NEW_TEXTURE, true); entry->SetGeneralParameters(address, texture_size, full_format); @@ -461,11 +441,6 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage) // load texture entry->Load(width, height, expandedWidth, 0); - if (entry->IsEfbCopy() && !g_ActiveConfig.bCopyEFBToTexture) - entry->type = TCET_EC_DYNAMIC; - else - entry->type = TCET_NORMAL; - std::string basename = ""; if (g_ActiveConfig.bDumpTextures && !hires_tex) { @@ -833,7 +808,6 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat entry->SetGeneralParameters(dstAddr, 0, dstFormat); entry->SetDimensions(tex_w, tex_h, 1); entry->SetHashes(TEXHASH_INVALID); - entry->type = TCET_EC_VRAM; entry->frameCount = FRAMECOUNT_INVALID; diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index 52f9e04e16..1d4ebe9ba7 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -20,13 +20,6 @@ struct VideoConfig; class TextureCache { public: - enum TexCacheEntryType - { - TCET_NORMAL, - TCET_EC_VRAM, // EFB copy which sits in VRAM and is ready to be used - TCET_EC_DYNAMIC, // EFB copy which sits in RAM and needs to be decoded before being used - }; - struct TCacheEntryConfig { TCacheEntryConfig() : width(0), height(0), levels(1), layers(1), rendertarget(false) {} @@ -61,8 +54,6 @@ public: u64 hash; u32 format; - enum TexCacheEntryType type; - unsigned int native_width, native_height; // Texture dimensions from the GameCube's point of view unsigned int native_levels; @@ -104,7 +95,7 @@ public: bool OverlapsMemoryRange(u32 range_address, u32 range_size) const; - bool IsEfbCopy() { return (type == TCET_EC_VRAM || type == TCET_EC_DYNAMIC); } + bool IsEfbCopy() { return config.rendertarget; } }; virtual ~TextureCache(); // needs virtual for DX11 dtor @@ -119,7 +110,6 @@ public: static void InvalidateRange(u32 start_address, u32 size); static void MakeRangeDynamic(u32 start_address, u32 size); static void ClearRenderTargets(); // currently only used by OGL - static bool Find(u32 start_address, u64 hash); virtual TCacheEntryBase* CreateTexture(const TCacheEntryConfig& config) = 0; diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index f6fe38d663..ef5fe26798 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -100,7 +100,6 @@ void VideoConfig::Load(const std::string& ini_file) hacks->Get("EFBCopyEnable", &bEFBCopyEnable, true); hacks->Get("EFBToTextureEnable", &bCopyEFBToTexture, true); hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true); - hacks->Get("EFBCopyCacheEnable", &bEFBCopyCacheEnable, false); hacks->Get("EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false); // Load common settings @@ -201,7 +200,6 @@ void VideoConfig::GameIniLoad() CHECK_SETTING("Video_Hacks", "EFBCopyEnable", bEFBCopyEnable); CHECK_SETTING("Video_Hacks", "EFBToTextureEnable", bCopyEFBToTexture); CHECK_SETTING("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled); - CHECK_SETTING("Video_Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable); CHECK_SETTING("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges); CHECK_SETTING("Video", "ProjectionHack", iPhackvalue[0]); @@ -290,7 +288,6 @@ void VideoConfig::Save(const std::string& ini_file) hacks->Set("EFBCopyEnable", bEFBCopyEnable); hacks->Set("EFBToTextureEnable", bCopyEFBToTexture); hacks->Set("EFBScaledCopy", bCopyEFBScaled); - hacks->Set("EFBCopyCacheEnable", bEFBCopyCacheEnable); hacks->Set("EFBEmulateFormatChanges", bEFBEmulateFormatChanges); iniFile.Save(ini_file); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 69684557e8..38e8047f75 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -114,7 +114,6 @@ struct VideoConfig final bool bPerfQueriesEnable; bool bEFBCopyEnable; - bool bEFBCopyCacheEnable; bool bEFBEmulateFormatChanges; bool bCopyEFBToTexture; bool bCopyEFBScaled; |
