From 1d8d1ff3d0b7dac3b3196eda02b063661872aad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 6 Oct 2021 19:49:34 +0200 Subject: [PATCH] Fix output for missing Vulkan surface extensions When the Vulkan loader is present but there are no required surface extensions, as will for example happen with the Null platform, glfwinfo caused an error in glfwGetPhysicalDevicePresentationSupport and produced confusing output. --- tests/glfwinfo.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/glfwinfo.c b/tests/glfwinfo.c index 87ed385f..dea3ac22 100644 --- a/tests/glfwinfo.c +++ b/tests/glfwinfo.c @@ -954,14 +954,17 @@ int main(int argc, char** argv) uint32_t qfp_count; vkGetPhysicalDeviceQueueFamilyProperties(pd[i], &qfp_count, NULL); - printf("Vulkan device queue family presentation support:\n"); - for (uint32_t j = 0; j < qfp_count; j++) + if (re) { - printf(" %u: ", j); - if (glfwGetPhysicalDevicePresentationSupport(instance, pd[i], j)) - printf("supported\n"); - else - printf("no\n"); + printf("Vulkan device queue family presentation support:\n"); + for (uint32_t j = 0; j < qfp_count; j++) + { + printf(" %u: ", j); + if (glfwGetPhysicalDevicePresentationSupport(instance, pd[i], j)) + printf("supported\n"); + else + printf("no\n"); + } } if (list_extensions)