Added support for per-example instance based extensions
This commit is contained in:
parent
e7c4e24717
commit
c918914bd4
2 changed files with 9 additions and 2 deletions
|
|
@ -44,6 +44,12 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation)
|
||||||
instanceExtensions.push_back(VK_MVK_MACOS_SURFACE_EXTENSION_NAME);
|
instanceExtensions.push_back(VK_MVK_MACOS_SURFACE_EXTENSION_NAME);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (enabledInstanceExtensions.size() > 0) {
|
||||||
|
for (auto enabledExtension : enabledInstanceExtensions) {
|
||||||
|
instanceExtensions.push_back(enabledExtension);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VkInstanceCreateInfo instanceCreateInfo = {};
|
VkInstanceCreateInfo instanceCreateInfo = {};
|
||||||
instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||||
instanceCreateInfo.pNext = NULL;
|
instanceCreateInfo.pNext = NULL;
|
||||||
|
|
@ -930,7 +936,7 @@ void VulkanExampleBase::initVulkan()
|
||||||
// This is handled by a separate class that gets a logical device representation
|
// This is handled by a separate class that gets a logical device representation
|
||||||
// and encapsulates functions related to a device
|
// and encapsulates functions related to a device
|
||||||
vulkanDevice = new vks::VulkanDevice(physicalDevice);
|
vulkanDevice = new vks::VulkanDevice(physicalDevice);
|
||||||
VkResult res = vulkanDevice->createLogicalDevice(enabledFeatures, enabledExtensions);
|
VkResult res = vulkanDevice->createLogicalDevice(enabledFeatures, enabledDeviceExtensions);
|
||||||
if (res != VK_SUCCESS) {
|
if (res != VK_SUCCESS) {
|
||||||
vks::tools::exitFatal("Could not create Vulkan device: \n" + vks::tools::errorString(res), res);
|
vks::tools::exitFatal("Could not create Vulkan device: \n" + vks::tools::errorString(res), res);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,8 @@ protected:
|
||||||
*/
|
*/
|
||||||
VkPhysicalDeviceFeatures enabledFeatures{};
|
VkPhysicalDeviceFeatures enabledFeatures{};
|
||||||
/** @brief Set of device extensions to be enabled for this example (must be set in the derived constructor) */
|
/** @brief Set of device extensions to be enabled for this example (must be set in the derived constructor) */
|
||||||
std::vector<const char*> enabledExtensions;
|
std::vector<const char*> enabledDeviceExtensions;
|
||||||
|
std::vector<const char*> enabledInstanceExtensions;
|
||||||
/** @brief Logical device, application's view of the physical device (GPU) */
|
/** @brief Logical device, application's view of the physical device (GPU) */
|
||||||
// todo: getter? should always point to VulkanDevice->device
|
// todo: getter? should always point to VulkanDevice->device
|
||||||
VkDevice device;
|
VkDevice device;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue