Skip to content

Commit a2224ab

Browse files
cube: Check return value of vkGetPhysicalDeviceSurfaceSupportKHR
1 parent 3dc27fa commit a2224ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cube/cube.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -4145,7 +4145,7 @@ static void demo_init_vk(struct demo *demo) {
41454145
volkLoadInstance(demo->inst);
41464146
}
41474147

4148-
static void demo_select_physical_device(struct demo* demo) {
4148+
static void demo_select_physical_device(struct demo *demo) {
41494149
VkResult err;
41504150
/* Make initial call to query gpu_count, then second call for gpu info */
41514151
uint32_t gpu_count = 0;
@@ -4192,8 +4192,8 @@ static void demo_select_physical_device(struct demo* demo) {
41924192

41934193
// Continue next gpu if this gpu does not support the surface.
41944194
VkBool32 supported = VK_FALSE;
4195-
vkGetPhysicalDeviceSurfaceSupportKHR(physical_devices[i], 0, demo->surface, &supported);
4196-
if (!supported) continue;
4195+
VkResult result = vkGetPhysicalDeviceSurfaceSupportKHR(physical_devices[i], 0, demo->surface, &supported);
4196+
if (result != VK_SUCCESS || !supported) continue;
41974197

41984198
int priority = 0;
41994199
switch (physicalDeviceProperties.deviceType) {

0 commit comments

Comments
 (0)