From cd9a5d1cc4891788e4e9e52b170d539b077e9c1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Tue, 3 Apr 2018 04:13:40 +0200 Subject: [PATCH] use first phy if only one present --- src/vkhelpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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