renderer_vulkan/wrapper: Add vkEnumerateInstanceExtensionProperties wrapper

This commit is contained in:
ReinUsesLisp 2020-03-31 21:30:19 -03:00
parent 27dd542c60
commit f22f6b72c3
2 changed files with 17 additions and 0 deletions

View file

@ -733,4 +733,18 @@ VkPhysicalDeviceMemoryProperties PhysicalDevice::GetMemoryProperties() const noe
return properties; return properties;
} }
std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProperties(
const InstanceDispatch& dld) {
u32 num;
if (dld.vkEnumerateInstanceExtensionProperties(nullptr, &num, nullptr) != VK_SUCCESS) {
return std::nullopt;
}
std::vector<VkExtensionProperties> properties(num);
if (dld.vkEnumerateInstanceExtensionProperties(nullptr, &num, properties.data()) !=
VK_SUCCESS) {
return std::nullopt;
}
return properties;
}
} // namespace Vulkan::vk } // namespace Vulkan::vk

View file

@ -981,4 +981,7 @@ private:
const DeviceDispatch* dld; const DeviceDispatch* dld;
}; };
std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProperties(
const InstanceDispatch& dld);
} // namespace Vulkan::vk } // namespace Vulkan::vk