diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-29 07:34:17 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-08-20 21:55:22 +0200 |
commit | 29a0ca23918092d252f440b2f55f68bb3c991366 (patch) | |
tree | edda29a9afa40fa3167641a79ad324a073de4ad5 /src/video_core/renderer_vulkan/wrapper.cpp | |
parent | Merge pull request #4546 from lioncash/telemetry (diff) | |
download | yuzu-29a0ca23918092d252f440b2f55f68bb3c991366.tar yuzu-29a0ca23918092d252f440b2f55f68bb3c991366.tar.gz yuzu-29a0ca23918092d252f440b2f55f68bb3c991366.tar.bz2 yuzu-29a0ca23918092d252f440b2f55f68bb3c991366.tar.lz yuzu-29a0ca23918092d252f440b2f55f68bb3c991366.tar.xz yuzu-29a0ca23918092d252f440b2f55f68bb3c991366.tar.zst yuzu-29a0ca23918092d252f440b2f55f68bb3c991366.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/wrapper.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/wrapper.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp index 013865aa4..56055af1b 100644 --- a/src/video_core/renderer_vulkan/wrapper.cpp +++ b/src/video_core/renderer_vulkan/wrapper.cpp @@ -10,6 +10,7 @@ #include <vector> #include "common/common_types.h" +#include "common/logging/log.h" #include "video_core/renderer_vulkan/wrapper.h" @@ -375,18 +376,17 @@ VkResult Free(VkDevice device, VkCommandPool handle, Span<VkCommandBuffer> buffe return VK_SUCCESS; } -Instance Instance::Create(Span<const char*> layers, Span<const char*> extensions, +Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char*> extensions, InstanceDispatch& dld) noexcept { - static constexpr VkApplicationInfo application_info{ + const VkApplicationInfo application_info{ .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = nullptr, .pApplicationName = "yuzu Emulator", .applicationVersion = VK_MAKE_VERSION(0, 1, 0), .pEngineName = "yuzu Emulator", .engineVersion = VK_MAKE_VERSION(0, 1, 0), - .apiVersion = VK_API_VERSION_1_1, + .apiVersion = version, }; - const VkInstanceCreateInfo ci{ .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, .pNext = nullptr, @@ -775,6 +775,21 @@ VkPhysicalDeviceMemoryProperties PhysicalDevice::GetMemoryProperties() const noe return properties; } +u32 AvailableVersion(const InstanceDispatch& dld) noexcept { + PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion; + if (!Proc(vkEnumerateInstanceVersion, dld, "vkEnumerateInstanceVersion")) { + // If the procedure is not found, Vulkan 1.0 is assumed + return VK_API_VERSION_1_0; + } + u32 version; + if (const VkResult result = vkEnumerateInstanceVersion(&version); result != VK_SUCCESS) { + LOG_ERROR(Render_Vulkan, "vkEnumerateInstanceVersion returned {}, assuming Vulkan 1.1", + ToString(result)); + return VK_API_VERSION_1_1; + } + return version; +} + std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProperties( const InstanceDispatch& dld) { u32 num; |