Module: wine Branch: master Commit: 67000f2969225a7eef75e41985580ba3a0d6a405 URL: https://source.winehq.org/git/wine.git/?a=commit;h=67000f2969225a7eef75e4198...
Author: Georg Lehmann dadschoorse@gmail.com Date: Tue Mar 23 18:42:47 2021 +0100
winevulkan: Implement vk_icdGetPhysicalDeviceProcAddr.
When using the windows vulkan loader vk_icdGetPhysicalDeviceProcAddr is used for unknown physical device functions. Fixes Red Dead Redemption 2 with vkd3d-proton. The game replaces wine's vulkan-1.dll with a windows version that doesn't know functions used by vkd3d-proton.
Signed-off-by: Georg Lehmann dadschoorse@gmail.com Signed-off-by: Joshua Ashton joshua@froggi.es Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/winevulkan/make_vulkan | 1 + dlls/winevulkan/vulkan.c | 11 ++++++++--- dlls/winevulkan/winevulkan.spec | 1 + 3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index ada68a1a451..c30beee981d 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -2676,6 +2676,7 @@ class VkGenerator(object): def generate_vulkan_spec(self, f): self._generate_copyright(f, spec_file=True) f.write("@ stdcall -private vk_icdGetInstanceProcAddr(ptr str) wine_vk_icdGetInstanceProcAddr\n") + f.write("@ stdcall -private vk_icdGetPhysicalDeviceProcAddr(ptr str) wine_vk_icdGetPhysicalDeviceProcAddr\n") f.write("@ stdcall -private vk_icdNegotiateLoaderICDInterfaceVersion(ptr) wine_vk_icdNegotiateLoaderICDInterfaceVersion\n") f.write("@ cdecl -norelay native_vkGetInstanceProcAddrWINE(ptr str)\n")
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 455d4eb3b2c..b2045295718 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -37,9 +37,7 @@ DEFINE_DEVPROPKEY(DEVPROPKEY_GPU_LUID, 0x60b193cb, 0x5276, 0x4d0f, 0x96, 0xfc, 0 DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_GPU_VULKAN_UUID, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5c, 2);
/* For now default to 4 as it felt like a reasonable version feature wise to support. - * Don't support the optional vk_icdGetPhysicalDeviceProcAddr introduced in this version - * as it is unlikely we will implement physical device extensions, which the loader is not - * aware of. Version 5 adds more extensive version checks. Something to tackle later. + * Version 5 adds more extensive version checks. Something to tackle later. */ #define WINE_VULKAN_ICD_VERSION 4
@@ -1239,6 +1237,13 @@ PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const return NULL; }
+void * WINAPI wine_vk_icdGetPhysicalDeviceProcAddr(VkInstance instance, const char *name) +{ + TRACE("%p, %s\n", instance, debugstr_a(name)); + + return wine_vk_get_phys_dev_proc_addr(name); +} + void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) { TRACE("%p, %s\n", instance, debugstr_a(name)); diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec index 30719e6583d..b9644ac41bb 100644 --- a/dlls/winevulkan/winevulkan.spec +++ b/dlls/winevulkan/winevulkan.spec @@ -9,6 +9,7 @@ #
@ stdcall -private vk_icdGetInstanceProcAddr(ptr str) wine_vk_icdGetInstanceProcAddr +@ stdcall -private vk_icdGetPhysicalDeviceProcAddr(ptr str) wine_vk_icdGetPhysicalDeviceProcAddr @ stdcall -private vk_icdNegotiateLoaderICDInterfaceVersion(ptr) wine_vk_icdNegotiateLoaderICDInterfaceVersion @ cdecl -norelay native_vkGetInstanceProcAddrWINE(ptr str) @ stdcall -private wine_vkAcquireNextImage2KHR(ptr ptr ptr)