mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 05:08:57 +00:00
OGL/ProgramShaderCache: Use std::lock_guard deduction guides where applicable
Same thing, less reading.
This commit is contained in:
parent
6e69e3cf26
commit
d6617d399f
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue