From a2224abf350f61211462a33e5b540201fa17de0d Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Wed, 27 Nov 2024 17:53:28 -0600 Subject: cube: Check return value of vkGetPhysicalDeviceSurfaceSupportKHR --- cube/cube.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cube/cube.c b/cube/cube.c index f1123ac2..d2b9bac4 100644 --- a/cube/cube.c +++ b/cube/cube.c @@ -4145,7 +4145,7 @@ static void demo_init_vk(struct demo *demo) { volkLoadInstance(demo->inst); } -static void demo_select_physical_device(struct demo* demo) { +static void demo_select_physical_device(struct demo *demo) { VkResult err; /* Make initial call to query gpu_count, then second call for gpu info */ uint32_t gpu_count = 0; @@ -4192,8 +4192,8 @@ static void demo_select_physical_device(struct demo* demo) { // Continue next gpu if this gpu does not support the surface. VkBool32 supported = VK_FALSE; - vkGetPhysicalDeviceSurfaceSupportKHR(physical_devices[i], 0, demo->surface, &supported); - if (!supported) continue; + VkResult result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_devices[i], 0, demo->surface, &supported); + if (result != VK_SUCCESS || !supported) continue; int priority = 0; switch (physicalDeviceProperties.deviceType) { -- cgit v1.2.3