From 6510e6d550258ee0d80d306a41a2598a7c749404 Mon Sep 17 00:00:00 2001 From: Lucas Alber Date: Wed, 18 Sep 2024 15:19:37 +0200 Subject: [PATCH] merian: fix build with fmt 11.0 --- .../merian/vk/descriptors/descriptor_set_layout.hpp | 5 +++-- src/merian/vk/context.cpp | 1 + src/merian/vk/extension/extension_resources.cpp | 10 ++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/merian/vk/descriptors/descriptor_set_layout.hpp b/include/merian/vk/descriptors/descriptor_set_layout.hpp index c6c681d..2cbe064 100644 --- a/include/merian/vk/descriptors/descriptor_set_layout.hpp +++ b/include/merian/vk/descriptors/descriptor_set_layout.hpp @@ -4,13 +4,14 @@ #include #include #include +#include namespace merian { class DescriptorSetLayout : public std::enable_shared_from_this { public: - DescriptorSetLayout(const ContextHandle context, + DescriptorSetLayout(const ContextHandle& context, const std::vector& bindings, const vk::DescriptorSetLayoutCreateFlags flags = {}) : context(context), bindings(bindings) { @@ -57,7 +58,7 @@ inline std::string format_as(const DescriptorSetLayoutHandle& layout) { std::vector binding_strs; - for (auto& binding : layout->get_bindings()) { + for (const auto& binding : layout->get_bindings()) { binding_strs.emplace_back( fmt::format("(binding = {}, count = {}, type = {}, stage flags = {})", binding.binding, binding.descriptorCount, vk::to_string(binding.descriptorType), diff --git a/src/merian/vk/context.cpp b/src/merian/vk/context.cpp index 88305f4..8ea2b34 100644 --- a/src/merian/vk/context.cpp +++ b/src/merian/vk/context.cpp @@ -4,6 +4,7 @@ #include "merian/vk/extension/extension.hpp" #include +#include #include VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE diff --git a/src/merian/vk/extension/extension_resources.cpp b/src/merian/vk/extension/extension_resources.cpp index 8b5ea0d..834edad 100644 --- a/src/merian/vk/extension/extension_resources.cpp +++ b/src/merian/vk/extension/extension_resources.cpp @@ -1,20 +1,22 @@ #include "merian/vk/extension/extension_resources.hpp" #include "merian/vk/memory/memory_allocator_vma.hpp" +#include + namespace merian { void ExtensionResources::on_physical_device_selected( const Context::PhysicalDeviceContainer& physical_device) { - for (auto& extension : physical_device.physical_device_extension_properties) { - if (!strcmp(extension.extensionName, "VK_KHR_maintenance4")) { + for (const auto& extension : physical_device.physical_device_extension_properties) { + if (strcmp(extension.extensionName, "VK_KHR_maintenance4") == 0) { required_extensions.push_back("VK_KHR_maintenance4"); flags |= VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT; } - if (!strcmp(extension.extensionName, "VK_KHR_maintenance5")) { + if (strcmp(extension.extensionName, "VK_KHR_maintenance5") == 0) { required_extensions.push_back("VK_KHR_maintenance5"); flags |= VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT; } - if (!strcmp(extension.extensionName, "VK_KHR_buffer_device_address")) { + if (strcmp(extension.extensionName, "VK_KHR_buffer_device_address") == 0) { required_extensions.push_back("VK_KHR_buffer_device_address"); } }