video_core: Replace lock_guard with scoped_lock

This commit is contained in:
Merry 2022-04-07 19:32:40 +01:00
parent 159ae5e47c
commit bbc585881a
11 changed files with 18 additions and 18 deletions

View file

@ -253,7 +253,7 @@ GraphicsPipeline::GraphicsPipeline(
}
}
if (in_parallel) {
std::lock_guard lock{built_mutex};
std::scoped_lock lock{built_mutex};
built_fence.Create();
// Flush this context to ensure compilation commands and fence are in the GPU pipe.
glFlush();

View file

@ -258,7 +258,7 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
[this, key, env = std::move(env), &state, &callback](Context* ctx) mutable {
ctx->pools.ReleaseContents();
auto pipeline{CreateComputePipeline(ctx->pools, key, env)};
std::lock_guard lock{state.mutex};
std::scoped_lock lock{state.mutex};
if (pipeline) {
compute_cache.emplace(key, std::move(pipeline));
}
@ -280,7 +280,7 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading,
}
ctx->pools.ReleaseContents();
auto pipeline{CreateGraphicsPipeline(ctx->pools, key, MakeSpan(env_ptrs), false)};
std::lock_guard lock{state.mutex};
std::scoped_lock lock{state.mutex};
if (pipeline) {
graphics_cache.emplace(key, std::move(pipeline));
}