From d2d37411bcd198a4615ddace4100b259e41b1814 Mon Sep 17 00:00:00 2001 From: GPUCode <47210458+GPUCode@users.noreply.github.com> Date: Sat, 16 Sep 2023 02:00:10 +0300 Subject: [PATCH] vk_platform: Check if vkEnumerateInstanceVersion exists before calling it (#6982) Co-authored-by: Vitor K --- src/video_core/renderer_vulkan/vk_platform.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_platform.cpp b/src/video_core/renderer_vulkan/vk_platform.cpp index 46390889ad..1f6fcfc1ba 100644 --- a/src/video_core/renderer_vulkan/vk_platform.cpp +++ b/src/video_core/renderer_vulkan/vk_platform.cpp @@ -288,12 +288,17 @@ vk::UniqueInstance CreateInstance(const Common::DynamicLibrary& library, } VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr); - const auto extensions = GetInstanceExtensions(window_type, enable_validation); + if (!VULKAN_HPP_DEFAULT_DISPATCHER.vkEnumerateInstanceVersion) { + throw std::runtime_error("Vulkan 1.0 is not supported, 1.1 is required!"); + } + const u32 available_version = vk::enumerateInstanceVersion(); if (available_version < VK_API_VERSION_1_1) { throw std::runtime_error("Vulkan 1.0 is not supported, 1.1 is required!"); } + const auto extensions = GetInstanceExtensions(window_type, enable_validation); + const vk::ApplicationInfo application_info = { .pApplicationName = "Citra", .applicationVersion = VK_MAKE_VERSION(1, 0, 0),