Module: wine Branch: master Commit: 902465f23603586fdb4f601c91618982f4071fe4 URL: https://gitlab.winehq.org/wine/wine/-/commit/902465f23603586fdb4f601c9161898...
Author: Alexandros Frantzis alexandros.frantzis@collabora.com Date: Mon Sep 20 10:56:18 2021 +0300
winewayland.drv: Implement vkGetDeviceProcAddr and vkGetInstanceProcAddr.
---
dlls/winewayland.drv/vulkan.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
diff --git a/dlls/winewayland.drv/vulkan.c b/dlls/winewayland.drv/vulkan.c index 9b8ee6ee9e2..d22b8401422 100644 --- a/dlls/winewayland.drv/vulkan.c +++ b/dlls/winewayland.drv/vulkan.c @@ -43,8 +43,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); static VkResult (*pvkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); static void (*pvkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); static VkResult (*pvkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); +static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *); +static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *);
static void *vulkan_handle; +static const struct vulkan_funcs vulkan_funcs;
/* Helper function for converting between win32 and Wayland compatible VkInstanceCreateInfo. * Caller is responsible for allocation and cleanup of 'dst'. */ @@ -170,6 +173,30 @@ static VkResult wayland_vkEnumerateInstanceExtensionProperties(const char *layer return res; }
+static void *wayland_vkGetDeviceProcAddr(VkDevice device, const char *name) +{ + void *proc_addr; + + TRACE("%p, %s\n", device, debugstr_a(name)); + + if ((proc_addr = get_vulkan_driver_device_proc_addr(&vulkan_funcs, name))) + return proc_addr; + + return pvkGetDeviceProcAddr(device, name); +} + +static void *wayland_vkGetInstanceProcAddr(VkInstance instance, const char *name) +{ + void *proc_addr; + + TRACE("%p, %s\n", instance, debugstr_a(name)); + + if ((proc_addr = get_vulkan_driver_instance_proc_addr(&vulkan_funcs, instance, name))) + return proc_addr; + + return pvkGetInstanceProcAddr(instance, name); +} + static void wine_vk_init(void) { if (!(vulkan_handle = dlopen(SONAME_LIBVULKAN, RTLD_NOW))) @@ -182,6 +209,8 @@ static void wine_vk_init(void) LOAD_FUNCPTR(vkCreateInstance); LOAD_FUNCPTR(vkDestroyInstance); LOAD_FUNCPTR(vkEnumerateInstanceExtensionProperties); + LOAD_FUNCPTR(vkGetDeviceProcAddr); + LOAD_FUNCPTR(vkGetInstanceProcAddr); #undef LOAD_FUNCPTR
return; @@ -196,6 +225,8 @@ static const struct vulkan_funcs vulkan_funcs = .p_vkCreateInstance = wayland_vkCreateInstance, .p_vkDestroyInstance = wayland_vkDestroyInstance, .p_vkEnumerateInstanceExtensionProperties = wayland_vkEnumerateInstanceExtensionProperties, + .p_vkGetDeviceProcAddr = wayland_vkGetDeviceProcAddr, + .p_vkGetInstanceProcAddr = wayland_vkGetInstanceProcAddr, };
/**********************************************************************