summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authormitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-09-30 17:26:50 -0700
committermitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-12-15 19:54:16 -0800
commit140252ffc0ae71e8b5309bff7d6550189c602702 (patch)
tree7e6fe317fc93e0d9fc91e089ec3af86af25565f1 /Source/Core/VideoBackends
parent860e6cf5cb7d96499aecf6f6067783bdb71c29ad (diff)
Modernize `std::any_of` with ranges
In WiimoteReal.cpp, JitRegCache.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates.
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/OGL/OGLGfx.cpp4
-rw-r--r--Source/Core/VideoBackends/Vulkan/VulkanContext.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLGfx.cpp b/Source/Core/VideoBackends/OGL/OGLGfx.cpp
index fa20a76d11..6a97aa5982 100644
--- a/Source/Core/VideoBackends/OGL/OGLGfx.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLGfx.cpp
@@ -304,8 +304,8 @@ void OGLGfx::DispatchComputeShader(const AbstractShader* shader, u32 groupsize_x
static_cast<const OGLPipeline*>(m_current_pipeline)->GetProgram()->shader.Bind();
// Barrier to texture can be used for reads.
- if (std::any_of(m_bound_image_textures.begin(), m_bound_image_textures.end(),
- [](auto image) { return image != nullptr; }))
+ if (std::ranges::any_of(m_bound_image_textures,
+ [](const auto* image) { return image != nullptr; }))
{
glMemoryBarrier(GL_TEXTURE_UPDATE_BARRIER_BIT);
}
diff --git a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp
index ed2407775a..ed3b709529 100644
--- a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp
+++ b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp
@@ -929,8 +929,8 @@ void VulkanContext::DisableDebugUtils()
bool VulkanContext::SupportsDeviceExtension(const char* name) const
{
- return std::any_of(m_device_extensions.begin(), m_device_extensions.end(),
- [name](const std::string& extension) { return extension == name; });
+ return std::ranges::any_of(m_device_extensions,
+ [name](const std::string& extension) { return extension == name; });
}
static bool DriverIsMesa(VkDriverId driver_id)