diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 4028ad32139..208d26bd44f 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -94,7 +94,7 @@ FUNCTION_OVERRIDES = { "vkEnumeratePhysicalDevices" : {"dispatch" : True, "driver" : False, "thunk" : False}, # Device functions - "vkGetDeviceProcAddr" : {"dispatch" : True, "driver" : True, "thunk" : True}, + "vkGetDeviceProcAddr" : {"dispatch" : True, "driver" : True, "thunk" : False}, } diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 83c94eb856a..ee877e0f800 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -352,6 +352,28 @@ VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *d return res; } +PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *name) +{ + void *func; + TRACE("%p, %s\n", device, debugstr_a(name)); + + /* The spec leaves return value undefined for a NULL device, let's just return NULL. */ + if (!device || !name) + return NULL; + + /* Per the spec, we are only supposed to return device functions as in functions + * for which the first parameter is vkDevice or a child of vkDevice like a + * vkCommandBuffer or vkQueue. + * Loader takes are of filtering of extensions which are enabled or not. + */ + func = wine_vk_get_device_proc_addr(name); + if (func) + return func; + + TRACE("Function %s not found\n", debugstr_a(name)); + return NULL; +} + static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name) { void *func; diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index f02ee3e2bf6..13a5d5d7ea1 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -690,12 +690,6 @@ static void WINAPI wine_vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMem FIXME("stub: %p, 0x%s, %p\n", device, wine_dbgstr_longlong(memory), pCommittedMemoryInBytes); } -static PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *pName) -{ - FIXME("stub: %p, %p\n", device, pName); - return NULL; -} - static void WINAPI wine_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) { FIXME("stub: %p, %u, %u, %p\n", device, queueFamilyIndex, queueIndex, pQueue); diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index f98307c9c96..9f5edf55b22 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -17,6 +17,7 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDev void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) DECLSPEC_HIDDEN; VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) DECLSPEC_HIDDEN; VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) DECLSPEC_HIDDEN; +PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *pName) DECLSPEC_HIDDEN; typedef struct VkImageFormatProperties_host {