Add support to test the vulkan example on CPU

This commit is contained in:
Nicolas Caramelli 2024-10-11 11:26:46 +02:00 committed by Vittorio Romeo
parent cabc36b8a4
commit 7a8d75b7ac

View File

@ -563,6 +563,8 @@ public:
return;
}
VkPhysicalDeviceType deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
// Look for a GPU that supports swapchains
for (VkPhysicalDevice dev : devices)
{
@ -608,6 +610,13 @@ public:
if (deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU)
{
gpu = dev;
deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
}
else if ((deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU) &&
(deviceType != VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU))
{
gpu = dev;
deviceType = VK_PHYSICAL_DEVICE_TYPE_CPU;
}
}