Signed-off-by: Józef Kucia jkucia@codeweavers.com ---
It shouldn't matter in practice, but it is consistent with requirements specified in the Vulkan spec.
--- dlls/winex11.drv/vulkan.c | 62 ++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 30 deletions(-)
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index ffa91a2e2ce7..54ed3b6962ad 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -480,6 +480,35 @@ static const struct vulkan_funcs vulkan_funcs = X11DRV_vkQueuePresentKHR, };
+static void *get_vulkan_driver_device_proc_addr(const struct vulkan_funcs *vulkan_funcs, + const char *name) +{ + if (!name || name[0] != 'v' || name[1] != 'k') + return NULL; + + name += 2; + + if (!strcmp(name, "AcquireNextImageKHR")) + return vulkan_funcs->p_vkAcquireNextImageKHR; + if (!strcmp(name, "CreateSwapchainKHR")) + return vulkan_funcs->p_vkCreateSwapchainKHR; + if (!strcmp(name, "DestroySwapchainKHR")) + return vulkan_funcs->p_vkDestroySwapchainKHR; + if (!strcmp(name, "GetDeviceProcAddr")) + return vulkan_funcs->p_vkGetDeviceProcAddr; + if (!strcmp(name, "GetSwapchainImagesKHR")) + return vulkan_funcs->p_vkGetSwapchainImagesKHR; + if (!strcmp(name, "QueuePresentKHR")) + return vulkan_funcs->p_vkQueuePresentKHR; + + return NULL; +} + +static void *X11DRV_get_vk_device_proc_addr(const char *name) +{ + return get_vulkan_driver_device_proc_addr(&vulkan_funcs, name); +} + static void *get_vulkan_driver_instance_proc_addr(const struct vulkan_funcs *vulkan_funcs, VkInstance instance, const char *name) { @@ -515,7 +544,9 @@ static void *get_vulkan_driver_instance_proc_addr(const struct vulkan_funcs *vul if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR")) return vulkan_funcs->p_vkGetPhysicalDeviceWin32PresentationSupportKHR;
- return NULL; + name -= 2; + + return get_vulkan_driver_device_proc_addr(vulkan_funcs, name); }
static void *X11DRV_get_vk_instance_proc_addr(VkInstance instance, const char *name) @@ -523,35 +554,6 @@ static void *X11DRV_get_vk_instance_proc_addr(VkInstance instance, const char *n return get_vulkan_driver_instance_proc_addr(&vulkan_funcs, instance, name); }
-static void *get_vulkan_driver_device_proc_addr(const struct vulkan_funcs *vulkan_funcs, - const char *name) -{ - if (!name || name[0] != 'v' || name[1] != 'k') - return NULL; - - name += 2; - - if (!strcmp(name, "AcquireNextImageKHR")) - return vulkan_funcs->p_vkAcquireNextImageKHR; - if (!strcmp(name, "CreateSwapchainKHR")) - return vulkan_funcs->p_vkCreateSwapchainKHR; - if (!strcmp(name, "DestroySwapchainKHR")) - return vulkan_funcs->p_vkDestroySwapchainKHR; - if (!strcmp(name, "GetDeviceProcAddr")) - return vulkan_funcs->p_vkGetDeviceProcAddr; - if (!strcmp(name, "GetSwapchainImagesKHR")) - return vulkan_funcs->p_vkGetSwapchainImagesKHR; - if (!strcmp(name, "QueuePresentKHR")) - return vulkan_funcs->p_vkQueuePresentKHR; - - return NULL; -} - -static void *X11DRV_get_vk_device_proc_addr(const char *name) -{ - return get_vulkan_driver_device_proc_addr(&vulkan_funcs, name); -} - const struct vulkan_funcs *get_vulkan_driver(UINT version) { if (version != WINE_VULKAN_DRIVER_VERSION)