vk_platform: Check if vkEnumerateInstanceVersion exists before calling it (#6982)

Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
This commit is contained in:
GPUCode 2023-09-16 02:00:10 +03:00 committed by GitHub
parent 43cedf59af
commit d2d37411bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -288,12 +288,17 @@ vk::UniqueInstance CreateInstance(const Common::DynamicLibrary& library,
} }
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr); 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(); const u32 available_version = vk::enumerateInstanceVersion();
if (available_version < VK_API_VERSION_1_1) { if (available_version < VK_API_VERSION_1_1) {
throw std::runtime_error("Vulkan 1.0 is not supported, 1.1 is required!"); 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 = { const vk::ApplicationInfo application_info = {
.pApplicationName = "Citra", .pApplicationName = "Citra",
.applicationVersion = VK_MAKE_VERSION(1, 0, 0), .applicationVersion = VK_MAKE_VERSION(1, 0, 0),