diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 1f308eec2..3111165fb 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -539,11 +539,13 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading | |||
| 539 | ShaderPools pools; | 539 | ShaderPools pools; |
| 540 | auto pipeline{CreateComputePipeline(pools, key, envs.front(), false)}; | 540 | auto pipeline{CreateComputePipeline(pools, key, envs.front(), false)}; |
| 541 | 541 | ||
| 542 | std::lock_guard lock{state.mutex}; | 542 | { |
| 543 | compute_cache.emplace(key, std::move(pipeline)); | 543 | std::lock_guard lock{state.mutex}; |
| 544 | ++state.built; | 544 | compute_cache.emplace(key, std::move(pipeline)); |
| 545 | if (state.has_loaded) { | 545 | ++state.built; |
| 546 | callback(VideoCore::LoadCallbackStage::Build, state.built, state.total); | 546 | if (state.has_loaded) { |
| 547 | callback(VideoCore::LoadCallbackStage::Build, state.built, state.total); | ||
| 548 | } | ||
| 547 | } | 549 | } |
| 548 | }); | 550 | }); |
| 549 | } else { | 551 | } else { |
| @@ -558,11 +560,13 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading | |||
| 558 | } | 560 | } |
| 559 | auto pipeline{CreateGraphicsPipeline(pools, key, MakeSpan(env_ptrs), false)}; | 561 | auto pipeline{CreateGraphicsPipeline(pools, key, MakeSpan(env_ptrs), false)}; |
| 560 | 562 | ||
| 561 | std::lock_guard lock{state.mutex}; | 563 | { |
| 562 | graphics_cache.emplace(key, std::move(pipeline)); | 564 | std::lock_guard lock{state.mutex}; |
| 563 | ++state.built; | 565 | graphics_cache.emplace(key, std::move(pipeline)); |
| 564 | if (state.has_loaded) { | 566 | ++state.built; |
| 565 | callback(VideoCore::LoadCallbackStage::Build, state.built, state.total); | 567 | if (state.has_loaded) { |
| 568 | callback(VideoCore::LoadCallbackStage::Build, state.built, state.total); | ||
| 569 | } | ||
| 566 | } | 570 | } |
| 567 | }); | 571 | }); |
| 568 | } | 572 | } |