From 8726ca81cb8ccf70a80f585b9bcdd3d5d6952436 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sat, 9 Sep 2017 13:42:58 +1000 Subject: [PATCH] physical_device: prefer try_array over manual queries --- physical_device.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/physical_device.cpp b/physical_device.cpp index 30df6ed..b6ee8e3 100644 --- a/physical_device.cpp +++ b/physical_device.cpp @@ -84,14 +84,9 @@ physical_device::memory_properties (void) const std::vector physical_device::queue_families (void) const { - uint32_t count = 0; - vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, nullptr); - - std::vector values (count); - vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, values.data ()); - - values.resize (count); - return values; + return error::try_array ( + vkGetPhysicalDeviceQueueFamilyProperties, native () + ); }