also this

This commit is contained in:
Mars 2024-09-29 23:05:15 -04:00
parent 01cdd533c5
commit df6ec77374
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5

View file

@ -92,17 +92,14 @@ class HelloTriangleApplication {
.engineVersion = 1,
.apiVersion = VK_API_VERSION_1_0 };
vk::InstanceCreateInfo createInfo { .pApplicationInfo = &appInfo };
// Retrieve extensions using custom function
std::vector<const char*> extensions = getRequiredExtensions();
if (enableValidationLayers) {
createInfo.setEnabledLayerCount(static_cast<uint32_t>(validationLayers.size()))
.setPpEnabledLayerNames(validationLayers.data());
} else {
createInfo.setEnabledLayerCount(0);
}
vk::InstanceCreateInfo createInfo {
.pApplicationInfo = &appInfo,
.enabledLayerCount = enableValidationLayers ? static_cast<uint32_t>(validationLayers.size()) : 0,
.ppEnabledLayerNames = enableValidationLayers ? validationLayers.data() : nullptr
};
// Enable the portability extension and set flags
extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);