Skip to content

Commit

Permalink
merian: fix build with fmt 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LDAP committed Sep 18, 2024
1 parent 818b2c6 commit 6510e6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions include/merian/vk/descriptors/descriptor_set_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#include <spdlog/spdlog.h>
#include <vector>
#include <vulkan/vulkan.hpp>
#include <fmt/ranges.h>

namespace merian {

class DescriptorSetLayout : public std::enable_shared_from_this<DescriptorSetLayout> {

public:
DescriptorSetLayout(const ContextHandle context,
DescriptorSetLayout(const ContextHandle& context,
const std::vector<vk::DescriptorSetLayoutBinding>& bindings,
const vk::DescriptorSetLayoutCreateFlags flags = {})
: context(context), bindings(bindings) {
Expand Down Expand Up @@ -57,7 +58,7 @@ inline std::string format_as(const DescriptorSetLayoutHandle& layout) {

std::vector<std::string> 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),
Expand Down
1 change: 1 addition & 0 deletions src/merian/vk/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "merian/vk/extension/extension.hpp"

#include <spdlog/spdlog.h>
#include <fmt/ranges.h>
#include <tuple>

VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
Expand Down
10 changes: 6 additions & 4 deletions src/merian/vk/extension/extension_resources.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#include "merian/vk/extension/extension_resources.hpp"
#include "merian/vk/memory/memory_allocator_vma.hpp"

#include <fmt/ranges.h>

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");
}
}
Expand Down

0 comments on commit 6510e6d

Please sign in to comment.