render/vulkan: use KHR variant for physical device properties

The Vulkan renderer calls vkGetPhysicalDeviceProperties2 while the
instance is created with API version 1.0. This violates the
specification because the function was promoted to core in 1.1. The
resulting validation error leads to undefined behavior and a crash on
drivers that enforce strict API checking (e.g. AMD RADV).

Replace the core function with the KHR extension variant, which is
available when VK_KHR_get_physical_device_properties_2 is enabled, and
maintains compatibility with Vulkan 1.0 instances.
This commit is contained in:
Furkan Sahin 2026-05-31 12:56:25 -04:00
parent bd99e8c2bd
commit dd745dbc37
3 changed files with 15 additions and 5 deletions

View file

@ -24,6 +24,8 @@ struct wlr_vk_instance {
PFN_vkCreateDebugUtilsMessengerEXT createDebugUtilsMessengerEXT;
PFN_vkDestroyDebugUtilsMessengerEXT destroyDebugUtilsMessengerEXT;
} api;
PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR;
};
// Creates and initializes a vulkan instance.
@ -75,7 +77,7 @@ struct wlr_vk_device {
// Tries to find the VkPhysicalDevice for the given drm fd.
// Might find none and return VK_NULL_HANDLE.
VkPhysicalDevice vulkan_find_drm_phdev(struct wlr_vk_instance *ini, int drm_fd);
int vulkan_open_phdev_drm_fd(VkPhysicalDevice phdev);
int vulkan_open_phdev_drm_fd(struct wlr_vk_instance *ini, VkPhysicalDevice phdev);
// Creates a device for the given instance and physical device.
struct wlr_vk_device *vulkan_device_create(struct wlr_vk_instance *ini,