physical_device: prefer try_array over manual queries

This commit is contained in:
Danny Robson 2017-09-09 13:42:58 +10:00
parent 7239fb26bf
commit 8726ca81cb

View File

@ -84,14 +84,9 @@ physical_device::memory_properties (void) const
std::vector<VkQueueFamilyProperties> std::vector<VkQueueFamilyProperties>
physical_device::queue_families (void) const physical_device::queue_families (void) const
{ {
uint32_t count = 0; return error::try_array (
vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, nullptr); vkGetPhysicalDeviceQueueFamilyProperties, native ()
);
std::vector<VkQueueFamilyProperties> values (count);
vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, values.data ());
values.resize (count);
return values;
} }