summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/wrapper.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-04-01 01:26:44 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-04-01 02:32:07 +0200
commit151ddcf419bcbe6e914b7cf47698744727671648 (patch)
tree4a62a6bc6f6d4741825cd06aa1656468017ef57f /src/video_core/renderer_vulkan/wrapper.h
parentMerge pull request #3566 from ReinUsesLisp/vk-wrapper-part1 (diff)
downloadyuzu-151ddcf419bcbe6e914b7cf47698744727671648.tar
yuzu-151ddcf419bcbe6e914b7cf47698744727671648.tar.gz
yuzu-151ddcf419bcbe6e914b7cf47698744727671648.tar.bz2
yuzu-151ddcf419bcbe6e914b7cf47698744727671648.tar.lz
yuzu-151ddcf419bcbe6e914b7cf47698744727671648.tar.xz
yuzu-151ddcf419bcbe6e914b7cf47698744727671648.tar.zst
yuzu-151ddcf419bcbe6e914b7cf47698744727671648.zip
Diffstat (limited to 'src/video_core/renderer_vulkan/wrapper.h')
-rw-r--r--src/video_core/renderer_vulkan/wrapper.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/wrapper.h b/src/video_core/renderer_vulkan/wrapper.h
index 686c2b9a1..8eb31e77d 100644
--- a/src/video_core/renderer_vulkan/wrapper.h
+++ b/src/video_core/renderer_vulkan/wrapper.h
@@ -542,4 +542,21 @@ using SurfaceKHR = Handle<VkSurfaceKHR, VkInstance, InstanceDispatch>;
using DescriptorSets = PoolAllocations<VkDescriptorSet, VkDescriptorPool>;
using CommandBuffers = PoolAllocations<VkCommandBuffer, VkCommandPool>;
+/// Vulkan instance owning handle.
+class Instance : public Handle<VkInstance, NoOwner, InstanceDispatch> {
+ using Handle<VkInstance, NoOwner, InstanceDispatch>::Handle;
+
+public:
+ /// Creates a Vulkan instance. Use "operator bool" for error handling.
+ static Instance Create(Span<const char*> layers, Span<const char*> extensions,
+ InstanceDispatch& dld) noexcept;
+
+ /// Enumerates physical devices.
+ /// @return Physical devices and an empty handle on failure.
+ std::optional<std::vector<VkPhysicalDevice>> EnumeratePhysicalDevices();
+
+ /// Tries to create a debug callback messenger. Returns an empty handle on failure.
+ DebugCallback TryCreateDebugCallback(PFN_vkDebugUtilsMessengerCallbackEXT callback) noexcept;
+};
+
} // namespace Vulkan::vk