Browse Source

vk_pipeline_cache: Small fixes to the pipeline cache

nce_cpp
FernandoS27 5 years ago
committed by ameerj
parent
commit
98c08894d9
  1. 4
      src/video_core/renderer_vulkan/vk_pipeline_cache.cpp

4
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp

@ -539,12 +539,14 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading
ShaderPools pools; ShaderPools pools;
auto pipeline{CreateComputePipeline(pools, key, envs.front(), false)}; auto pipeline{CreateComputePipeline(pools, key, envs.front(), false)};
{
std::lock_guard lock{state.mutex}; std::lock_guard lock{state.mutex};
compute_cache.emplace(key, std::move(pipeline)); compute_cache.emplace(key, std::move(pipeline));
++state.built; ++state.built;
if (state.has_loaded) { if (state.has_loaded) {
callback(VideoCore::LoadCallbackStage::Build, state.built, state.total); callback(VideoCore::LoadCallbackStage::Build, state.built, state.total);
} }
}
}); });
} else { } else {
GraphicsPipelineCacheKey key; GraphicsPipelineCacheKey key;
@ -558,12 +560,14 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading
} }
auto pipeline{CreateGraphicsPipeline(pools, key, MakeSpan(env_ptrs), false)}; auto pipeline{CreateGraphicsPipeline(pools, key, MakeSpan(env_ptrs), false)};
{
std::lock_guard lock{state.mutex}; std::lock_guard lock{state.mutex};
graphics_cache.emplace(key, std::move(pipeline)); graphics_cache.emplace(key, std::move(pipeline));
++state.built; ++state.built;
if (state.has_loaded) { if (state.has_loaded) {
callback(VideoCore::LoadCallbackStage::Build, state.built, state.total); callback(VideoCore::LoadCallbackStage::Build, state.built, state.total);
} }
}
}); });
} }
++state.total; ++state.total;

Loading…
Cancel
Save