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_vulkan | |
| 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_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index f8a1bcf34..970979fa1 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -230,7 +230,7 @@ vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpa | |||
| 230 | if (!attribute.enabled) { | 230 | if (!attribute.enabled) { |
| 231 | continue; | 231 | continue; |
| 232 | } | 232 | } |
| 233 | if (input_attributes.find(static_cast<u32>(index)) == input_attributes.end()) { | 233 | if (!input_attributes.contains(static_cast<u32>(index))) { |
| 234 | // Skip attributes not used by the vertex shaders. | 234 | // Skip attributes not used by the vertex shaders. |
| 235 | continue; | 235 | continue; |
| 236 | } | 236 | } |
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 5748eab3a..ca12b3793 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |||
| @@ -2125,8 +2125,7 @@ private: | |||
| 2125 | OpStore(z_pointer, depth); | 2125 | OpStore(z_pointer, depth); |
| 2126 | } | 2126 | } |
| 2127 | if (stage == ShaderType::Fragment) { | 2127 | if (stage == ShaderType::Fragment) { |
| 2128 | const auto SafeGetRegister = [&](u32 reg) { | 2128 | const auto SafeGetRegister = [this](u32 reg) { |
| 2129 | // TODO(Rodrigo): Replace with contains once C++20 releases | ||
| 2130 | if (const auto it = registers.find(reg); it != registers.end()) { | 2129 | if (const auto it = registers.find(reg); it != registers.end()) { |
| 2131 | return OpLoad(t_float, it->second); | 2130 | return OpLoad(t_float, it->second); |
| 2132 | } | 2131 | } |