From 2148c8f7cc73966419e89ee36ec221832e8b04e5 Mon Sep 17 00:00:00 2001 From: Kuchinawa Date: Sat, 4 Jan 2025 22:27:31 +0100 Subject: [PATCH] Fix for MacOS compat --- VulVoxOptimizationProject/vulkan_instance.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/VulVoxOptimizationProject/vulkan_instance.cpp b/VulVoxOptimizationProject/vulkan_instance.cpp index 5c419c4..1c5602f 100644 --- a/VulVoxOptimizationProject/vulkan_instance.cpp +++ b/VulVoxOptimizationProject/vulkan_instance.cpp @@ -27,8 +27,18 @@ namespace vulvox const char** glfw_extensions; glfw_extensions = glfwGetRequiredInstanceExtensions(&glfw_extension_count); - create_info.enabledExtensionCount = glfw_extension_count; - create_info.ppEnabledExtensionNames = glfw_extensions; + std::vector requiredExtensions; + + for (uint32_t i = 0; i < glfw_extension_count; i++) { + requiredExtensions.emplace_back(glfw_extensions[i]); + } + + requiredExtensions.emplace_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); + + create_info.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; + + create_info.enabledExtensionCount = (uint32_t)requiredExtensions.size(); + create_info.ppEnabledExtensionNames = requiredExtensions.data(); if (enableValidationLayers) {