From 92ed26e4eeabdb02638f6e1ebd92f21a82c97b02 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Sun, 5 Jan 2025 15:19:11 -0800 Subject: [PATCH] vulkan: Move `addPointerToChain` to `utils.h` --- core/rend/vulkan/utils.h | 17 +++++++++++++++++ core/rend/vulkan/vulkan_context.cpp | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/rend/vulkan/utils.h b/core/rend/vulkan/utils.h index 93f9fb66f0..c829fc4580 100644 --- a/core/rend/vulkan/utils.h +++ b/core/rend/vulkan/utils.h @@ -78,6 +78,23 @@ static inline u32 findMemoryType(vk::PhysicalDeviceMemoryProperties const& memor return typeIndex; } +static inline void addPointerToChain(void* head, const void* ptr) +{ + vk::BaseInStructure* prevInStructure = static_cast(head); + while (prevInStructure->pNext) + { + // Structure already in chain + if (prevInStructure->pNext == ptr) + { + return; + } + prevInStructure = const_cast(prevInStructure->pNext); + } + + // Add structure to end + prevInStructure->pNext = static_cast(ptr); +} + static const char GouraudSource[] = R"( #if pp_Gouraud == 0 #define INTERPOLATION flat diff --git a/core/rend/vulkan/vulkan_context.cpp b/core/rend/vulkan/vulkan_context.cpp index c9e0629c9d..d21203b14b 100644 --- a/core/rend/vulkan/vulkan_context.cpp +++ b/core/rend/vulkan/vulkan_context.cpp @@ -471,23 +471,6 @@ bool VulkanContext::InitDevice() } // Get device features - const auto addPointerToChain = [](void* head, const void* ptr) -> void - { - vk::BaseInStructure* prevInStructure = static_cast(head); - while (prevInStructure->pNext) - { - // Structure already in chain - if (prevInStructure->pNext == ptr) - { - return; - } - prevInStructure = const_cast(prevInStructure->pNext); - } - - // Add structure to end - prevInStructure->pNext = static_cast(ptr); - }; - vk::PhysicalDeviceFeatures2 featuresChain{}; vk::PhysicalDeviceFeatures& features = featuresChain.features;