From: Jean-Philippe Bruyère Date: Tue, 3 Apr 2018 02:13:40 +0000 (+0200) Subject: use first phy if only one present X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=cd9a5d1cc4891788e4e9e52b170d539b077e9c1f;p=jp%2Fvkhelpers.git use first phy if only one present --- diff --git a/src/vkhelpers.c b/src/vkhelpers.c index 1e1104a..257a0ee 100644 --- a/src/vkhelpers.c +++ b/src/vkhelpers.c @@ -5,11 +5,12 @@ VkPhysicalDevice vkh_find_phy (VkInstance inst, VkPhysicalDeviceType phyType) { uint32_t gpu_count = 0; VK_CHECK_RESULT(vkEnumeratePhysicalDevices (inst, &gpu_count, NULL)); - VkPhysicalDevice phys[gpu_count]; - VK_CHECK_RESULT(vkEnumeratePhysicalDevices (inst, &gpu_count, &phys)); + if (gpu_count == 1) + return phys[0]; + for (int i=0; i