summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2012-12-22 17:30:13 +0100
committerdegasus <wickmarkus@web.de>2012-12-22 17:30:13 +0100
commitffddfd8662bda4fedcfcc8cad73f02bd7a522925 (patch)
tree1bef07b897abc91a4a481d772a17826cd9e6cb09 /Source/Core/VideoCommon
parent2df0c31d13372bc29d488cf7e80d4adb9cf28b46 (diff)
do only invalid hashes instead of all textures on loading
this is a hack, but only the gpu thread is allowed to call ogl commands suggestion: create an unused texture cache, so we can move all textures there
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/MainBase.cpp2
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.cpp12
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/MainBase.cpp b/Source/Core/VideoCommon/Src/MainBase.cpp
index b5e72b1d8d..6e0fb530db 100644
--- a/Source/Core/VideoCommon/Src/MainBase.cpp
+++ b/Source/Core/VideoCommon/Src/MainBase.cpp
@@ -203,7 +203,7 @@ void VideoBackendHardware::DoState(PointerWrap& p)
// Clear all caches that touch RAM
// (? these don't appear to touch any emulation state that gets saved. moved to on load only.)
- TextureCache::Invalidate();
+ TextureCache::InvalidateHashes();
VertexLoaderManager::MarkAllDirty();
}
}
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
index 7c47c35bb6..2bcaead19c 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
@@ -72,6 +72,18 @@ void TextureCache::Invalidate()
textures.clear();
}
+// this function is dirty hack to work around a OGL bug.
+// it is only used on loading states. It will work for normal textures,
+// but for efb2ram, it wouldn't be checked. So there may be glitches on loading
+void TextureCache::InvalidateHashes()
+{
+ TexCache::iterator
+ iter = textures.begin(),
+ tcend = textures.end();
+ for (; iter != tcend; ++iter)
+ iter->second->hash = TEXHASH_INVALID;
+}
+
TextureCache::~TextureCache()
{
Invalidate();
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.h b/Source/Core/VideoCommon/Src/TextureCacheBase.h
index 4ef3b8a985..4d7124f215 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.h
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.h
@@ -106,6 +106,7 @@ public:
static void Cleanup();
static void Invalidate();
+ static void InvalidateHashes();
static void InvalidateRange(u32 start_address, u32 size);
static void MakeRangeDynamic(u32 start_address, u32 size);
static void ClearRenderTargets(); // currently only used by OGL