diff options
| author | Charles Giessen <charles@lunarg.com> | 2024-11-27 17:53:28 -0600 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2024-11-27 17:49:44 -0700 |
| commit | a2224abf350f61211462a33e5b540201fa17de0d (patch) | |
| tree | 230e35918be3720e90c88275fd3e0b27611f60b1 | |
| parent | 3dc27faaab9b346298c28cb6c9891ade8b1f8579 (diff) | |
| download | usermoji-a2224abf350f61211462a33e5b540201fa17de0d.tar.xz | |
cube: Check return value of vkGetPhysicalDeviceSurfaceSupportKHR
| -rw-r--r-- | cube/cube.c | 6 |
1 files 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) { |
