1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-09 23:54:20 +00:00

Examples: Vulkan: pick integrated GPU if nothing else is available. (#6359)

This commit is contained in:
kimidaisuki22 2023-04-23 04:45:45 +00:00 committed by ocornut
parent 0fbf2888e7
commit 565aa0b763
3 changed files with 9 additions and 1 deletions

View file

@ -99,6 +99,10 @@ static VkPhysicalDevice SetupVulkan_SelectPhysicalDevice()
if (properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU)
return device;
}
// Use first GPU (Integrated) is a Discrete one is not available.
if (gpu_count > 0)
return gpus[0];
return VK_NULL_HANDLE;
}