mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
OGL/ProgramShaderCache: Use std::lock_guard deduction guides where applicable
Same thing, less reading.
This commit is contained in:
@ -519,7 +519,7 @@ PipelineProgram* ProgramShaderCache::GetPipelineProgram(const GLVertexFormat* ve
|
|||||||
geometry_shader ? geometry_shader->GetID() : 0,
|
geometry_shader ? geometry_shader->GetID() : 0,
|
||||||
pixel_shader ? pixel_shader->GetID() : 0};
|
pixel_shader ? pixel_shader->GetID() : 0};
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> guard(s_pipeline_program_lock);
|
std::lock_guard guard{s_pipeline_program_lock};
|
||||||
auto iter = s_pipeline_programs.find(key);
|
auto iter = s_pipeline_programs.find(key);
|
||||||
if (iter != s_pipeline_programs.end())
|
if (iter != s_pipeline_programs.end())
|
||||||
{
|
{
|
||||||
@ -597,7 +597,7 @@ PipelineProgram* ProgramShaderCache::GetPipelineProgram(const GLVertexFormat* ve
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lock to insert. A duplicate program may have been created in the meantime.
|
// Lock to insert. A duplicate program may have been created in the meantime.
|
||||||
std::lock_guard<std::mutex> guard(s_pipeline_program_lock);
|
std::lock_guard guard{s_pipeline_program_lock};
|
||||||
auto iter = s_pipeline_programs.find(key);
|
auto iter = s_pipeline_programs.find(key);
|
||||||
if (iter != s_pipeline_programs.end())
|
if (iter != s_pipeline_programs.end())
|
||||||
{
|
{
|
||||||
@ -627,8 +627,8 @@ void ProgramShaderCache::ReleasePipelineProgram(PipelineProgram* prog)
|
|||||||
|
|
||||||
prog->shader.Destroy();
|
prog->shader.Destroy();
|
||||||
|
|
||||||
std::lock_guard<std::mutex> guard(s_pipeline_program_lock);
|
std::lock_guard guard{s_pipeline_program_lock};
|
||||||
auto iter = s_pipeline_programs.find(prog->key);
|
const auto iter = s_pipeline_programs.find(prog->key);
|
||||||
ASSERT(iter != s_pipeline_programs.end() && prog == iter->second.get());
|
ASSERT(iter != s_pipeline_programs.end() && prog == iter->second.get());
|
||||||
s_pipeline_programs.erase(iter);
|
s_pipeline_programs.erase(iter);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user