diff options
| author | baby.lueshi <baby.lueshi@gmail.com> | 2011-02-08 03:47:59 +0000 |
|---|---|---|
| committer | baby.lueshi <baby.lueshi@gmail.com> | 2011-02-08 03:47:59 +0000 |
| commit | 1f0663c1a870ccf3928bd24f27613a1e0f154abb (patch) | |
| tree | 21c0a065cbcc982d13a003e87646e903fa624a05 /Source/Core/VideoCommon/Src/TextureCacheBase.cpp | |
| parent | f0adc3adb46cb74b71bc2c95d82a4c0662f65d9a (diff) | |
Defer texture invalidation to the video thread from the video configuration dialog. Should fix issue 4069
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7108 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureCacheBase.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp index af53b0184b..47d2cf56c8 100644 --- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp @@ -26,7 +26,7 @@ TextureCache *g_texture_cache; u8 *TextureCache::temp = NULL; TextureCache::TexCache TextureCache::textures; -Common::CriticalSection TextureCache::texMutex; +bool TextureCache::DeferredInvalidate; TextureCache::TCacheEntryBase::~TCacheEntryBase() { @@ -53,7 +53,6 @@ TextureCache::TextureCache() void TextureCache::Invalidate(bool shutdown) { - texMutex.Enter(); TexCache::iterator iter = textures.begin(), tcend = textures.end(); @@ -68,7 +67,13 @@ void TextureCache::Invalidate(bool shutdown) if(g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures) HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str()); SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures); - texMutex.Leave(); + + DeferredInvalidate = false; +} + +void TextureCache::InvalidateDefer() +{ + DeferredInvalidate = true; } TextureCache::~TextureCache() |
