diff --git a/examples/vulkan/Vulkan.cpp b/examples/vulkan/Vulkan.cpp index 1b0d40e21..9a42cc5e4 100644 --- a/examples/vulkan/Vulkan.cpp +++ b/examples/vulkan/Vulkan.cpp @@ -563,6 +563,8 @@ public: return; } + VkPhysicalDeviceType deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER; + // Look for a GPU that supports swapchains for (VkPhysicalDevice dev : devices) { @@ -607,7 +609,14 @@ public: } if (deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) { - gpu = dev; + 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; } }