Roderick Colenbrander : winevulkan: Implement vkGetDeviceProcAddr.

Alexandre Julliard julliard at winehq.org
Fri Mar 9 16:11:51 CST 2018


Module: wine
Branch: master
Commit: a2a53bb6186fba3fae4bc5910eaf1cb8c2b6becd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a2a53bb6186fba3fae4bc5910eaf1cb8c2b6becd

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Fri Mar  9 08:48:49 2018 -0800

winevulkan: Implement vkGetDeviceProcAddr.

Signed-off-by: Roderick Colenbrander <thunderbird2k at gmail.com>
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winevulkan/make_vulkan     |  2 +-
 dlls/winevulkan/vulkan.c        | 22 ++++++++++++++++++++++
 dlls/winevulkan/vulkan_thunks.c |  6 ------
 dlls/winevulkan/vulkan_thunks.h |  1 +
 4 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
index 4028ad3..208d26b 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 83c94eb..ee877e0 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 f02ee3e..13a5d5d 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 f98307c9..9f5edf5 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
 {




More information about the wine-cvs mailing list