Skip to content

Commit 6976b57

Browse files
committed
gpu: Move device ranking to the bottom of IsDeviceSuitable.
This prevents devices without presentation/graphics support from getting ranked.
1 parent 799c6aa commit 6976b57

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/gpu/vulkan/SDL_gpu_vulkan.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11425,15 +11425,6 @@ static Uint8 VULKAN_INTERNAL_IsDeviceSuitable(
1142511425
return 0;
1142611426
}
1142711427

11428-
// Device rank depends on extension support, do NOT move this block any higher!
11429-
if (!VULKAN_INTERNAL_GetDeviceRank(
11430-
renderer,
11431-
physicalDevice,
11432-
physicalDeviceExtensions,
11433-
deviceRank)) {
11434-
return 0;
11435-
}
11436-
1143711428
renderer->vkGetPhysicalDeviceQueueFamilyProperties(
1143811429
physicalDevice,
1143911430
&queueFamilyCount,
@@ -11508,6 +11499,15 @@ static Uint8 VULKAN_INTERNAL_IsDeviceSuitable(
1150811499
return 0;
1150911500
}
1151011501

11502+
// Now that we know this device supports what we need, rank it against any other devices
11503+
if (!VULKAN_INTERNAL_GetDeviceRank(
11504+
renderer,
11505+
physicalDevice,
11506+
physicalDeviceExtensions,
11507+
deviceRank)) {
11508+
return 0;
11509+
}
11510+
1151111511
// FIXME: Need better structure for checking vs storing swapchain support details
1151211512
return 1;
1151311513
}

0 commit comments

Comments
 (0)