From c1ceea1405a5fd834b545df1aecb8155bdc99b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 15 Jul 2026 11:57:27 +0200 Subject: [PATCH] Correct Vulkan initialization for devices that don't support Vulkan 1.1. --- Common/GPU/Vulkan/VulkanContext.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Common/GPU/Vulkan/VulkanContext.cpp b/Common/GPU/Vulkan/VulkanContext.cpp index 3ada9e445f..46778e47f2 100644 --- a/Common/GPU/Vulkan/VulkanContext.cpp +++ b/Common/GPU/Vulkan/VulkanContext.cpp @@ -204,8 +204,9 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) { // Validate that all the instance extensions we ask for are actually available. for (auto ext : instance_extensions_enabled_) { - if (!IsInstanceExtensionAvailable(ext)) + if (!IsInstanceExtensionAvailable(ext)) { WARN_LOG(Log::G3D, "WARNING: Does not seem that instance extension '%s' is available. Trying to proceed anyway.", ext); + } } VkApplicationInfo app_info{ VK_STRUCTURE_TYPE_APPLICATION_INFO }; @@ -286,6 +287,17 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) { if (extensionsLookup_.KHR_get_physical_device_properties2 && vkGetPhysicalDeviceProperties2) { for (uint32_t i = 0; i < gpu_count; i++) { + // Now, we need to do a special check for vkGetPhysicalDeviceProperties2. Unfortunately, it is not valid to call it + // if the *device* is below 1.1. + + VkPhysicalDeviceProperties tempProps{}; + vkGetPhysicalDeviceProperties(physical_devices_[i], &tempProps); + if (tempProps.apiVersion < VK_API_VERSION_1_1) { + // This device is too old to support vkGetPhysicalDeviceProperties2, so we will just use the old function. + vkGetPhysicalDeviceProperties(physical_devices_[i], &physicalDeviceProperties_[i].properties); + continue; + } + VkPhysicalDeviceProperties2 props2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2}; VkPhysicalDevicePushDescriptorPropertiesKHR pushProps{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR}; VkPhysicalDeviceExternalMemoryHostPropertiesEXT extHostMemProps{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT};