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>
physical_device::queue_families (void) const
{
uint32_t count = 0;
vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, nullptr);
std::vector<VkQueueFamilyProperties> values (count);
vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, values.data ());
values.resize (count);
return values;
return error::try_array (
vkGetPhysicalDeviceQueueFamilyProperties, native ()
);
}