summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2025-03-23 15:56:13 -0400
committerGitHub <noreply@github.com>2025-03-23 15:56:13 -0400
commitad3650abfcae6432338ba976123958ee67a4106c (patch)
tree23def284c9a42648ea0779f94903ba43903aa353 /Source/Core/VideoCommon/TextureCacheBase.cpp
parent1515cf6ccdd1ba206c8e0eaabad07de28a4f5939 (diff)
parente4efe011d71b668537bc551996848e911de079ab (diff)
Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection
Ranges Algorithms Modernization - Projection
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 303a5f5b44..b370481c04 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -1663,11 +1663,8 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry(
if (!assets_data.empty())
{
const auto calculate_max_levels = [&]() {
- const auto max_element = std::max_element(
- assets_data.begin(), assets_data.end(), [](const auto& lhs, const auto& rhs) {
- return lhs->m_texture.m_slices[0].m_levels.size() <
- rhs->m_texture.m_slices[0].m_levels.size();
- });
+ const auto max_element = std::ranges::max_element(
+ assets_data, {}, [](const auto& v) { return v->m_texture.m_slices[0].m_levels.size(); });
return (*max_element)->m_texture.m_slices[0].m_levels.size();
};
const u32 texLevels = no_mips ? 1 : (u32)calculate_max_levels();
@@ -2024,8 +2021,7 @@ void TextureCacheBase::StitchXFBCopy(RcTcacheEntry& stitched_entry)
if (candidates.empty())
return;
- std::sort(candidates.begin(), candidates.end(),
- [](const TCacheEntry* a, const TCacheEntry* b) { return a->id < b->id; });
+ std::ranges::sort(candidates, {}, &TCacheEntry::id);
// We only upscale when necessary to preserve resolution. i.e. when there are upscaled partial
// copies to be stitched together.