summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-07-19 02:07:12 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:40 +0200
commit258f35515d61d01049d2e433146cab808837bb7d (patch)
treed7259d17dbbba65229a9473f1efef18149769a3b /src/video_core/renderer_opengl
parentcmake: Remove shader cache version (diff)
downloadyuzu-258f35515d61d01049d2e433146cab808837bb7d.tar
yuzu-258f35515d61d01049d2e433146cab808837bb7d.tar.gz
yuzu-258f35515d61d01049d2e433146cab808837bb7d.tar.bz2
yuzu-258f35515d61d01049d2e433146cab808837bb7d.tar.lz
yuzu-258f35515d61d01049d2e433146cab808837bb7d.tar.xz
yuzu-258f35515d61d01049d2e433146cab808837bb7d.tar.zst
yuzu-258f35515d61d01049d2e433146cab808837bb7d.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index 7ecafc862..8d6cc074c 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -48,9 +48,12 @@ using VideoCommon::ComputeEnvironment;
using VideoCommon::FileEnvironment;
using VideoCommon::GenericEnvironment;
using VideoCommon::GraphicsEnvironment;
+using VideoCommon::LoadPipelines;
using VideoCommon::SerializePipeline;
using Context = ShaderContext::Context;
+constexpr u32 CACHE_VERSION = 5;
+
template <typename Container>
auto MakeSpan(Container& container) {
return std::span(container.data(), container.size());
@@ -287,7 +290,7 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
});
++state.total;
}};
- VideoCommon::LoadPipelines(stop_loading, shader_cache_filename, load_compute, load_graphics);
+ LoadPipelines(stop_loading, shader_cache_filename, CACHE_VERSION, load_compute, load_graphics);
std::unique_lock lock{state.mutex};
callback(VideoCore::LoadCallbackStage::Build, 0, state.total);
@@ -394,7 +397,7 @@ std::unique_ptr<GraphicsPipeline> ShaderCache::CreateGraphicsPipeline() {
env_ptrs.push_back(&environments.envs[index]);
}
}
- SerializePipeline(graphics_key, env_ptrs, shader_cache_filename);
+ SerializePipeline(graphics_key, env_ptrs, shader_cache_filename, CACHE_VERSION);
return pipeline;
}
@@ -492,7 +495,8 @@ std::unique_ptr<ComputePipeline> ShaderCache::CreateComputePipeline(
if (!pipeline || shader_cache_filename.empty()) {
return pipeline;
}
- SerializePipeline(key, std::array<const GenericEnvironment*, 1>{&env}, shader_cache_filename);
+ SerializePipeline(key, std::array<const GenericEnvironment*, 1>{&env}, shader_cache_filename,
+ CACHE_VERSION);
return pipeline;
}