From f22f6b72c3ebef386abdce2efbc829a8113e8b9b Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 31 Mar 2020 21:30:19 -0300 Subject: renderer_vulkan/wrapper: Add vkEnumerateInstanceExtensionProperties wrapper --- src/video_core/renderer_vulkan/wrapper.cpp | 14 ++++++++++++++ src/video_core/renderer_vulkan/wrapper.h | 3 +++ 2 files changed, 17 insertions(+) (limited to 'src/video_core') diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp index 242cfff6e..9b94dfff1 100644 --- a/src/video_core/renderer_vulkan/wrapper.cpp +++ b/src/video_core/renderer_vulkan/wrapper.cpp @@ -733,4 +733,18 @@ VkPhysicalDeviceMemoryProperties PhysicalDevice::GetMemoryProperties() const noe return properties; } +std::optional> EnumerateInstanceExtensionProperties( + const InstanceDispatch& dld) { + u32 num; + if (dld.vkEnumerateInstanceExtensionProperties(nullptr, &num, nullptr) != VK_SUCCESS) { + return std::nullopt; + } + std::vector properties(num); + if (dld.vkEnumerateInstanceExtensionProperties(nullptr, &num, properties.data()) != + VK_SUCCESS) { + return std::nullopt; + } + return properties; +} + } // namespace Vulkan::vk diff --git a/src/video_core/renderer_vulkan/wrapper.h b/src/video_core/renderer_vulkan/wrapper.h index 1f91cceb2..fb3657819 100644 --- a/src/video_core/renderer_vulkan/wrapper.h +++ b/src/video_core/renderer_vulkan/wrapper.h @@ -981,4 +981,7 @@ private: const DeviceDispatch* dld; }; +std::optional> EnumerateInstanceExtensionProperties( + const InstanceDispatch& dld); + } // namespace Vulkan::vk -- cgit v1.2.3