summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/ShaderCache.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-04-02 01:01:08 +1000
committerStenzek <stenzek@gmail.com>2018-04-02 01:13:24 +1000
commit8587403e0e454f176a1b259285c3d0ab703adcdf (patch)
tree97b30e5dbb7650db6d68dfbc35620e88c1cfed56 /Source/Core/VideoCommon/ShaderCache.cpp
parent36ea2f7a263ac64f60d9caabc56d7cd319a29fea (diff)
ShaderCache: Write currently-known UIDs to cache when re-creating file
This way, if we load a UID cache where the data was incomplete (e.g. Dolphin crashed), we don't lose the existing UIDs which were previously at the beginning.
Diffstat (limited to 'Source/Core/VideoCommon/ShaderCache.cpp')
-rw-r--r--Source/Core/VideoCommon/ShaderCache.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp
index 12166d2d4c..cd7ec4ced9 100644
--- a/Source/Core/VideoCommon/ShaderCache.cpp
+++ b/Source/Core/VideoCommon/ShaderCache.cpp
@@ -602,6 +602,12 @@ void ShaderCache::LoadPipelineUIDCache()
m_gx_pipeline_uid_cache_file.WriteBytes(&CACHE_FILE_MAGIC, sizeof(GX_PIPELINE_UID_VERSION));
m_gx_pipeline_uid_cache_file.WriteBytes(&GX_PIPELINE_UID_VERSION,
sizeof(GX_PIPELINE_UID_VERSION));
+
+ // Write any current UIDs out to the file.
+ // This way, if we load a UID cache where the data was incomplete (e.g. Dolphin crashed),
+ // we don't lose the existing UIDs which were previously at the beginning.
+ for (const auto& it : m_gx_pipeline_cache)
+ AppendGXPipelineUID(it.first);
}
}