diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 670e76f0..f12e533a 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -44,6 +44,12 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation) instanceExtensions.push_back(VK_MVK_MACOS_SURFACE_EXTENSION_NAME); #endif + if (enabledInstanceExtensions.size() > 0) { + for (auto enabledExtension : enabledInstanceExtensions) { + instanceExtensions.push_back(enabledExtension); + } + } + VkInstanceCreateInfo instanceCreateInfo = {}; instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; instanceCreateInfo.pNext = NULL; @@ -930,7 +936,7 @@ void VulkanExampleBase::initVulkan() // This is handled by a separate class that gets a logical device representation // and encapsulates functions related to a device vulkanDevice = new vks::VulkanDevice(physicalDevice); - VkResult res = vulkanDevice->createLogicalDevice(enabledFeatures, enabledExtensions); + VkResult res = vulkanDevice->createLogicalDevice(enabledFeatures, enabledDeviceExtensions); if (res != VK_SUCCESS) { vks::tools::exitFatal("Could not create Vulkan device: \n" + vks::tools::errorString(res), res); } diff --git a/base/vulkanexamplebase.h b/base/vulkanexamplebase.h index 1ac2e14b..f461bb9c 100644 --- a/base/vulkanexamplebase.h +++ b/base/vulkanexamplebase.h @@ -90,7 +90,8 @@ protected: */ VkPhysicalDeviceFeatures enabledFeatures{}; /** @brief Set of device extensions to be enabled for this example (must be set in the derived constructor) */ - std::vector enabledExtensions; + std::vector enabledDeviceExtensions; + std::vector enabledInstanceExtensions; /** @brief Logical device, application's view of the physical device (GPU) */ // todo: getter? should always point to VulkanDevice->device VkDevice device;