mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-14 00:58:51 +02:00
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
This commit is contained in:
@ -203,7 +203,7 @@ void VideoBackendHardware::DoState(PointerWrap& p)
|
|||||||
|
|
||||||
// Clear all caches that touch RAM
|
// Clear all caches that touch RAM
|
||||||
// (? these don't appear to touch any emulation state that gets saved. moved to on load only.)
|
// (? these don't appear to touch any emulation state that gets saved. moved to on load only.)
|
||||||
TextureCache::Invalidate();
|
TextureCache::InvalidateHashes();
|
||||||
VertexLoaderManager::MarkAllDirty();
|
VertexLoaderManager::MarkAllDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,18 @@ void TextureCache::Invalidate()
|
|||||||
textures.clear();
|
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()
|
TextureCache::~TextureCache()
|
||||||
{
|
{
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
@ -106,6 +106,7 @@ public:
|
|||||||
static void Cleanup();
|
static void Cleanup();
|
||||||
|
|
||||||
static void Invalidate();
|
static void Invalidate();
|
||||||
|
static void InvalidateHashes();
|
||||||
static void InvalidateRange(u32 start_address, u32 size);
|
static void InvalidateRange(u32 start_address, u32 size);
|
||||||
static void MakeRangeDynamic(u32 start_address, u32 size);
|
static void MakeRangeDynamic(u32 start_address, u32 size);
|
||||||
static void ClearRenderTargets(); // currently only used by OGL
|
static void ClearRenderTargets(); // currently only used by OGL
|
||||||
|
Reference in New Issue
Block a user