summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-07-18 21:07:12 -0300
committerGravatar ameerj2021-07-22 21:51:40 -0400
commit258f35515d61d01049d2e433146cab808837bb7d (patch)
treed7259d17dbbba65229a9473f1efef18149769a3b /src/video_core/renderer_vulkan
parentcmake: Remove shader cache version (diff)
downloadyuzu-258f35515d61d01049d2e433146cab808837bb7d.tar.gz
yuzu-258f35515d61d01049d2e433146cab808837bb7d.tar.xz
yuzu-258f35515d61d01049d2e433146cab808837bb7d.zip
shader_environment: Receive cache version from outside
This allows us invalidating OpenGL and Vulkan separately in the future.
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 39db35175..2ce8b4156 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -54,6 +54,8 @@ using VideoCommon::FileEnvironment;
54using VideoCommon::GenericEnvironment; 54using VideoCommon::GenericEnvironment;
55using VideoCommon::GraphicsEnvironment; 55using VideoCommon::GraphicsEnvironment;
56 56
57constexpr u32 CACHE_VERSION = 5;
58
57template <typename Container> 59template <typename Container>
58auto MakeSpan(Container& container) { 60auto MakeSpan(Container& container) {
59 return std::span(container.data(), container.size()); 61 return std::span(container.data(), container.size());
@@ -434,7 +436,8 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading
434 }); 436 });
435 ++state.total; 437 ++state.total;
436 }}; 438 }};
437 VideoCommon::LoadPipelines(stop_loading, pipeline_cache_filename, load_compute, load_graphics); 439 VideoCommon::LoadPipelines(stop_loading, pipeline_cache_filename, CACHE_VERSION, load_compute,
440 load_graphics);
438 441
439 std::unique_lock lock{state.mutex}; 442 std::unique_lock lock{state.mutex};
440 callback(VideoCore::LoadCallbackStage::Build, 0, state.total); 443 callback(VideoCore::LoadCallbackStage::Build, 0, state.total);
@@ -562,7 +565,7 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline() {
562 env_ptrs.push_back(&envs[index]); 565 env_ptrs.push_back(&envs[index]);
563 } 566 }
564 } 567 }
565 SerializePipeline(key, env_ptrs, pipeline_cache_filename); 568 SerializePipeline(key, env_ptrs, pipeline_cache_filename, CACHE_VERSION);
566 }); 569 });
567 return pipeline; 570 return pipeline;
568} 571}
@@ -581,7 +584,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
581 } 584 }
582 serialization_thread.QueueWork([this, key, env = std::move(env)] { 585 serialization_thread.QueueWork([this, key, env = std::move(env)] {
583 SerializePipeline(key, std::array<const GenericEnvironment*, 1>{&env}, 586 SerializePipeline(key, std::array<const GenericEnvironment*, 1>{&env},
584 pipeline_cache_filename); 587 pipeline_cache_filename, CACHE_VERSION);
585 }); 588 });
586 return pipeline; 589 return pipeline;
587} 590}