From c8f34f94d35ae5b9f8a263f41aadf7d0cfddb918 Mon Sep 17 00:00:00 2001 From: Mac Date: Mon, 31 Aug 2026 23:39:50 +0530 Subject: [PATCH] build: fix clang-cl compile of ResourceTracking Tracker::IndirectImagePlan lives in an anonymous namespace, so std::projected cannot be formed for it and the three std::ranges algorithms over m_indirect_images fail to compile under clang-cl with the MSVC STL: error: function 'std::projected<..., std::identity>::operator*' is used but not defined in this translation unit, and cannot be defined in any other translation unit because its type does not have linkage Using the iterator-pair overloads compiles and is otherwise identical. Seen with clang-cl and MSVC 14.29 (VS2019) STL. CI does not catch this because its build targets are launcher and the smaller test binaries; kyty_emulator, which is what pulls in this file, is never built there. --- .../shader/recompiler/ir/passes/ResourceTracking.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp b/src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp index 302126569..eb0275ef7 100644 --- a/src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp +++ b/src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp @@ -139,7 +139,8 @@ public: } std::erase_if(m_program.dynamic_reads, [&](Value value) { const auto* inst = value.Resolve().TryInstruction(); - return std::ranges::any_of(m_indirect_images, [&](const IndirectImagePlan& plan) { + return std::any_of(m_indirect_images.begin(), m_indirect_images.end(), + [&](const IndirectImagePlan& plan) { return std::ranges::find(plan.reads, inst) != plan.reads.end(); }); }); @@ -432,14 +433,16 @@ private: const IndirectImagePlan* FindIndirectImage(const Inst& handle) const { const auto found = - std::ranges::find_if(m_indirect_images, [&](const IndirectImagePlan& plan) { + std::find_if(m_indirect_images.begin(), m_indirect_images.end(), + [&](const IndirectImagePlan& plan) { return plan.handle == &handle; }); return found == m_indirect_images.end() ? nullptr : &*found; } bool IsIndirectPlanningMemory(uint32_t index) const { - return std::ranges::any_of(m_indirect_images, [&](const IndirectImagePlan& plan) { + return std::any_of(m_indirect_images.begin(), m_indirect_images.end(), + [&](const IndirectImagePlan& plan) { return std::ranges::find(plan.memory, index) != plan.memory.end(); }); }