From df6ec7737467635965f5dc7147ab7d77f24bb135 Mon Sep 17 00:00:00 2001 From: Mars Date: Sun, 29 Sep 2024 23:05:15 -0400 Subject: [PATCH] also this --- src/main.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b69803c..5967653 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 extensions = getRequiredExtensions(); - if (enableValidationLayers) { - createInfo.setEnabledLayerCount(static_cast(validationLayers.size())) - .setPpEnabledLayerNames(validationLayers.data()); - } else { - createInfo.setEnabledLayerCount(0); - } + vk::InstanceCreateInfo createInfo { + .pApplicationInfo = &appInfo, + .enabledLayerCount = enableValidationLayers ? static_cast(validationLayers.size()) : 0, + .ppEnabledLayerNames = enableValidationLayers ? validationLayers.data() : nullptr + }; // Enable the portability extension and set flags extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);