From b9da3b879cb6d7e2a70204b7d549f331755ee473 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 7 Dec 2021 05:48:09 +0300 Subject: [PATCH] Fix possible exception on Vulkan example startup This change fixes possible exception on Vulkan example startup when validationLayers.size()) is zero. --- examples/vulkan/Vulkan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/vulkan/Vulkan.cpp b/examples/vulkan/Vulkan.cpp index ade2d14fa..c750029c3 100644 --- a/examples/vulkan/Vulkan.cpp +++ b/examples/vulkan/Vulkan.cpp @@ -473,9 +473,9 @@ public: instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; instanceCreateInfo.pApplicationInfo = &applicationInfo; instanceCreateInfo.enabledLayerCount = static_cast(validationLayers.size()); - instanceCreateInfo.ppEnabledLayerNames = &validationLayers[0]; + instanceCreateInfo.ppEnabledLayerNames = validationLayers.data(); instanceCreateInfo.enabledExtensionCount = static_cast(requiredExtentions.size()); - instanceCreateInfo.ppEnabledExtensionNames = &requiredExtentions[0]; + instanceCreateInfo.ppEnabledExtensionNames = requiredExtentions.data(); // Try to create a Vulkan instance with debug report enabled VkResult result = vkCreateInstance(&instanceCreateInfo, 0, &instance);