winex11: Return Wine Vulkan driver device functions from vkGetInstanceProcAddr().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-03-29 14:53:50 +02:00 committed by Alexandre Julliard
parent 45cea4b459
commit efddcedd16
1 changed files with 32 additions and 30 deletions

View File

@ -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)