diff options
| author | 2020-12-07 16:30:36 -0500 | |
|---|---|---|
| committer | 2020-12-07 16:30:39 -0500 | |
| commit | 09fa1d6a739b18f6a8f3d83065ff9aebd6e4bc8d (patch) | |
| tree | 3ea0bbe356d45a250b1b5300773bc2c419a39c19 /src/video_core/renderer_opengl | |
| parent | Merge pull request #5149 from comex/xx-map-interval (diff) | |
| download | yuzu-09fa1d6a739b18f6a8f3d83065ff9aebd6e4bc8d.tar.gz yuzu-09fa1d6a739b18f6a8f3d83065ff9aebd6e4bc8d.tar.xz yuzu-09fa1d6a739b18f6a8f3d83065ff9aebd6e4bc8d.zip | |
video_core: Make use of ordered container contains() where applicable
With C++20, we can use the more concise contains() member function
instead of comparing the result of the find() call with the end
iterator.
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_arb_decompiler.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp index 78066cc63..3e4d88c30 100644 --- a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp | |||
| @@ -1485,9 +1485,7 @@ void ARBDecompiler::Exit() { | |||
| 1485 | } | 1485 | } |
| 1486 | 1486 | ||
| 1487 | const auto safe_get_register = [this](u32 reg) -> std::string { | 1487 | const auto safe_get_register = [this](u32 reg) -> std::string { |
| 1488 | // TODO(Rodrigo): Replace with contains once C++20 releases | 1488 | if (ir.GetRegisters().contains(reg)) { |
| 1489 | const auto& used_registers = ir.GetRegisters(); | ||
| 1490 | if (used_registers.find(reg) != used_registers.end()) { | ||
| 1491 | return fmt::format("R{}.x", reg); | 1489 | return fmt::format("R{}.x", reg); |
| 1492 | } | 1490 | } |
| 1493 | return "{0, 0, 0, 0}.x"; | 1491 | return "{0, 0, 0, 0}.x"; |
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 0b96481f5..eabfdea5d 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -459,7 +459,7 @@ void ShaderCacheOpenGL::LoadDiskCache(u64 title_id, const std::atomic_bool& stop | |||
| 459 | ProgramSharedPtr ShaderCacheOpenGL::GeneratePrecompiledProgram( | 459 | ProgramSharedPtr ShaderCacheOpenGL::GeneratePrecompiledProgram( |
| 460 | const ShaderDiskCacheEntry& entry, const ShaderDiskCachePrecompiled& precompiled_entry, | 460 | const ShaderDiskCacheEntry& entry, const ShaderDiskCachePrecompiled& precompiled_entry, |
| 461 | const std::unordered_set<GLenum>& supported_formats) { | 461 | const std::unordered_set<GLenum>& supported_formats) { |
| 462 | if (supported_formats.find(precompiled_entry.binary_format) == supported_formats.end()) { | 462 | if (!supported_formats.contains(precompiled_entry.binary_format)) { |
| 463 | LOG_INFO(Render_OpenGL, "Precompiled cache entry with unsupported format, removing"); | 463 | LOG_INFO(Render_OpenGL, "Precompiled cache entry with unsupported format, removing"); |
| 464 | return {}; | 464 | return {}; |
| 465 | } | 465 | } |
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 70dd0c3c6..955b2abc4 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | |||
| @@ -343,7 +343,7 @@ void ShaderDiskCacheOpenGL::SaveEntry(const ShaderDiskCacheEntry& entry) { | |||
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | const u64 id = entry.unique_identifier; | 345 | const u64 id = entry.unique_identifier; |
| 346 | if (stored_transferable.find(id) != stored_transferable.end()) { | 346 | if (stored_transferable.contains(id)) { |
| 347 | // The shader already exists | 347 | // The shader already exists |
| 348 | return; | 348 | return; |
| 349 | } | 349 | } |