diff options
| author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2021-01-03 17:38:29 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-03 17:38:29 -0300 |
| commit | 7265e80c12de2d24d759ee6956a2445bf9ac8992 (patch) | |
| tree | 3236d949fdf894b985a8dcafc580cd233ebd9a68 /src/video_core/vulkan_common/vulkan_instance.h | |
| parent | 71e18dddbe14464160ac2d90e42d8b41da3d2e21 (diff) | |
| parent | cdbee27692d73046cecf56fdea1c90f72ebbc0ce (diff) | |
Merge pull request #5230 from ReinUsesLisp/vulkan-common
vulkan_common: Move reusable Vulkan abstractions to a separate directory
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_instance.h')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_instance.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_instance.h b/src/video_core/vulkan_common/vulkan_instance.h new file mode 100644 index 000000000..e5e3a7144 --- /dev/null +++ b/src/video_core/vulkan_common/vulkan_instance.h @@ -0,0 +1,32 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" +#include "common/dynamic_library.h" +#include "core/frontend/emu_window.h" +#include "video_core/vulkan_common/vulkan_wrapper.h" + +namespace Vulkan { + +/** + * Create a Vulkan instance + * + * @param library Dynamic library to load the Vulkan instance from + * @param dld Dispatch table to load function pointers into + * @param required_version Required Vulkan version (for example, VK_API_VERSION_1_1) + * @param window_type Window system type's enabled extension + * @param enable_debug_utils Whether to enable VK_EXT_debug_utils_extension_name or not + * @param enable_layers Whether to enable Vulkan validation layers or not + * + * @return A new Vulkan instance + * @throw vk::Exception on failure + */ +[[nodiscard]] vk::Instance CreateInstance( + const Common::DynamicLibrary& library, vk::InstanceDispatch& dld, u32 required_version, + Core::Frontend::WindowSystemType window_type = Core::Frontend::WindowSystemType::Headless, + bool enable_debug_utils = false, bool enable_layers = false); + +} // namespace Vulkan |
