From c26f40229aa6265b7ed62ffceee7cc94fe1f63a5 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 23 Aug 2023 14:07:45 +0100 Subject: [PATCH] [vulkan] Query wine_vk{Acquire,Release}KeyedMutex Non-standard functions, but exposed by winevulkan to support keyed mutexes. Co-authored-by: Paul Gofman --- src/vulkan/vulkan_loader.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vulkan/vulkan_loader.h b/src/vulkan/vulkan_loader.h index a8c450ce611..185779e52ab 100644 --- a/src/vulkan/vulkan_loader.h +++ b/src/vulkan/vulkan_loader.h @@ -9,6 +9,9 @@ #define VULKAN_FN(name) \ ::PFN_ ## name name = reinterpret_cast<::PFN_ ## name>(sym(#name)) +using PFN_wine_vkAcquireKeyedMutex = VkResult (VKAPI_PTR *)(VkDevice device, VkDeviceMemory memory, uint64_t key, uint32_t timeout_ms); +using PFN_wine_vkReleaseKeyedMutex = VkResult (VKAPI_PTR *)(VkDevice device, VkDeviceMemory memory, uint64_t key); + namespace dxvk::vk { /** @@ -436,6 +439,12 @@ namespace dxvk::vk { #ifdef VK_KHR_PRESENT_WAIT_EXTENSION_NAME VULKAN_FN(vkWaitForPresentKHR); #endif + + #ifdef VK_KHR_win32_keyed_mutex + // Wine additions to actually use this extension. + VULKAN_FN(wine_vkAcquireKeyedMutex); + VULKAN_FN(wine_vkReleaseKeyedMutex); + #endif }; }