From 8692cf6e59d5b5fd3ffa2a6407efb864608882ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Wed, 20 Mar 2019 13:11:35 +0100 Subject: [PATCH] winevulkan: Implement VK_KHR_external_semaphore_capabilities. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't support any handle type yet. Signed-off-by: Józef Kucia Signed-off-by: Alexandre Julliard --- dlls/vulkan-1/vulkan-1.spec | 2 +- dlls/winevulkan/make_vulkan | 5 ++++- dlls/winevulkan/vulkan.c | 18 ++++++++++++++++++ dlls/winevulkan/vulkan_thunks.c | 3 +++ dlls/winevulkan/vulkan_thunks.h | 2 ++ dlls/winevulkan/winevulkan.spec | 2 +- include/wine/vulkan.h | 6 ++++++ 7 files changed, 35 insertions(+), 3 deletions(-) diff --git a/dlls/vulkan-1/vulkan-1.spec b/dlls/vulkan-1/vulkan-1.spec index 104d6938267..88e4eb72f58 100644 --- a/dlls/vulkan-1/vulkan-1.spec +++ b/dlls/vulkan-1/vulkan-1.spec @@ -180,7 +180,7 @@ @ stub vkGetPhysicalDeviceDisplayPropertiesKHR @ stdcall vkGetPhysicalDeviceExternalBufferProperties(ptr ptr ptr) winevulkan.wine_vkGetPhysicalDeviceExternalBufferProperties @ stdcall vkGetPhysicalDeviceExternalFenceProperties(ptr ptr ptr) winevulkan.wine_vkGetPhysicalDeviceExternalFenceProperties -@ stub vkGetPhysicalDeviceExternalSemaphoreProperties +@ stdcall vkGetPhysicalDeviceExternalSemaphoreProperties(ptr ptr ptr) winevulkan.wine_vkGetPhysicalDeviceExternalSemaphoreProperties @ stdcall vkGetPhysicalDeviceFeatures(ptr ptr) winevulkan.wine_vkGetPhysicalDeviceFeatures @ stdcall vkGetPhysicalDeviceFeatures2(ptr ptr) winevulkan.wine_vkGetPhysicalDeviceFeatures2 @ stdcall vkGetPhysicalDeviceFormatProperties(ptr long ptr) winevulkan.wine_vkGetPhysicalDeviceFormatProperties diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 7a4aa4d8d67..8b0ed0c13ec 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -120,7 +120,6 @@ BLACKLISTED_EXTENSIONS = [ "VK_KHR_external_semaphore", "VK_KHR_shader_float16_int8", # Relates to external_semaphore and needs type conversions in bitflags. - "VK_KHR_external_semaphore_capabilities", "VK_KHR_shared_presentable_image", # Needs WSI work. "VK_KHR_win32_keyed_mutex", "VK_NV_cooperative_matrix", @@ -166,6 +165,7 @@ FUNCTION_OVERRIDES = { "vkEnumeratePhysicalDevices" : {"dispatch" : True, "driver" : False, "thunk" : False}, "vkGetPhysicalDeviceExternalBufferProperties" : {"dispatch" : False, "driver" : False, "thunk" : False}, "vkGetPhysicalDeviceExternalFenceProperties" : {"dispatch" : False, "driver" : False, "thunk" : False}, + "vkGetPhysicalDeviceExternalSemaphoreProperties" : {"dispatch" : False, "driver" : False, "thunk" : False}, "vkGetPhysicalDeviceImageFormatProperties2" : {"dispatch" : True, "driver" : False, "thunk" : True, "private_thunk" : True}, # Device functions @@ -204,6 +204,9 @@ FUNCTION_OVERRIDES = { "vkGetPhysicalDeviceExternalBufferPropertiesKHR" : {"dispatch" : False, "driver" : False, "thunk" : False}, "vkGetPhysicalDeviceImageFormatProperties2KHR" : {"dispatch" : True, "driver" : False, "thunk" : True, "private_thunk" : True}, + # VK_KHR_external_semaphore_capabilities + "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : False, "driver" : False, "thunk" : False}, + # VK_KHR_device_group_creation "vkEnumeratePhysicalDeviceGroupsKHR" : {"dispatch" : True, "driver" : False, "thunk" : False}, diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 1728f3b7dcd..4387aa8b0a2 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1327,6 +1327,24 @@ VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevi return res; } +void WINAPI wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice phys_dev, + const VkPhysicalDeviceExternalSemaphoreInfo *semaphore_info, VkExternalSemaphoreProperties *properties) +{ + TRACE("%p, %p, %p\n", phys_dev, semaphore_info, properties); + properties->exportFromImportedHandleTypes = 0; + properties->compatibleHandleTypes = 0; + properties->externalSemaphoreFeatures = 0; +} + +void WINAPI wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice phys_dev, + const VkPhysicalDeviceExternalSemaphoreInfo *semaphore_info, VkExternalSemaphoreProperties *properties) +{ + TRACE("%p, %p, %p\n", phys_dev, semaphore_info, properties); + properties->exportFromImportedHandleTypes = 0; + properties->compatibleHandleTypes = 0; + properties->externalSemaphoreFeatures = 0; +} + BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved) { TRACE("%p, %u, %p\n", hinst, reason, reserved); diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 225d68927ab..ae4bcb20605 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -3542,6 +3542,8 @@ static const struct vulkan_func vk_instance_dispatch_table[] = {"vkGetPhysicalDeviceExternalBufferPropertiesKHR", &wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR}, {"vkGetPhysicalDeviceExternalFenceProperties", &wine_vkGetPhysicalDeviceExternalFenceProperties}, {"vkGetPhysicalDeviceExternalFencePropertiesKHR", &wine_vkGetPhysicalDeviceExternalFencePropertiesKHR}, + {"vkGetPhysicalDeviceExternalSemaphoreProperties", &wine_vkGetPhysicalDeviceExternalSemaphoreProperties}, + {"vkGetPhysicalDeviceExternalSemaphorePropertiesKHR", &wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR}, {"vkGetPhysicalDeviceFeatures", &wine_vkGetPhysicalDeviceFeatures}, {"vkGetPhysicalDeviceFeatures2", &wine_vkGetPhysicalDeviceFeatures2}, {"vkGetPhysicalDeviceFeatures2KHR", &wine_vkGetPhysicalDeviceFeatures2KHR}, @@ -3708,6 +3710,7 @@ static const char * const vk_instance_extensions[] = "VK_KHR_device_group_creation", "VK_KHR_external_fence_capabilities", "VK_KHR_external_memory_capabilities", + "VK_KHR_external_semaphore_capabilities", "VK_KHR_get_physical_device_properties2", "VK_KHR_surface", "VK_KHR_win32_surface", diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 5c99ffd580c..4e14ac79695 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -60,6 +60,8 @@ void WINAPI wine_vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice ph void WINAPI wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties) DECLSPEC_HIDDEN; void WINAPI wine_vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); void WINAPI wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties) DECLSPEC_HIDDEN; +void WINAPI wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); +void WINAPI wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties) DECLSPEC_HIDDEN; VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties); VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) DECLSPEC_HIDDEN; VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence); diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec index 626b47e4399..57ee94abe26 100644 --- a/dlls/winevulkan/winevulkan.spec +++ b/dlls/winevulkan/winevulkan.spec @@ -183,7 +183,7 @@ @ stub vkGetPhysicalDeviceDisplayPropertiesKHR @ stdcall -private wine_vkGetPhysicalDeviceExternalBufferProperties(ptr ptr ptr) @ stdcall -private wine_vkGetPhysicalDeviceExternalFenceProperties(ptr ptr ptr) -@ stub vkGetPhysicalDeviceExternalSemaphoreProperties +@ stdcall -private wine_vkGetPhysicalDeviceExternalSemaphoreProperties(ptr ptr ptr) @ stdcall -private wine_vkGetPhysicalDeviceFeatures(ptr ptr) @ stdcall -private wine_vkGetPhysicalDeviceFeatures2(ptr ptr) @ stdcall -private wine_vkGetPhysicalDeviceFormatProperties(ptr long ptr) diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index ae93a5d1204..0754b03c839 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -148,6 +148,8 @@ #define VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHR_device_group_creation" #define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_memory_capabilities" +#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_semaphore_capabilities" #define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 2 #define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" #define VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION 1 @@ -5400,6 +5402,8 @@ typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhys typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo *, VkExternalBufferProperties *); typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFenceProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo *, VkExternalFenceProperties *); typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo *, VkExternalFenceProperties *); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *); +typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *, VkExternalSemaphoreProperties *); typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice, VkPhysicalDeviceFeatures *); typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice, VkPhysicalDeviceFeatures2 *); @@ -5658,6 +5662,8 @@ void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice phy void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties); void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); +void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); +void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures); void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures); void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures);