From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/vulkan.c | 78 ++++++++++ dlls/winevulkan/loader_thunks.c | 25 +++ dlls/winevulkan/loader_thunks.h | 17 +++ dlls/winevulkan/make_vulkan | 14 +- dlls/winevulkan/vulkan_thunks.c | 263 +++++++++++++++++++++++++++++++- dlls/winevulkan/vulkan_thunks.h | 2 - include/wine/vulkan.h | 52 +++++++ include/wine/vulkan_driver.h | 8 +- 8 files changed, 441 insertions(+), 18 deletions(-)
diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 6e5f81966b8..6baed63fecd 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1062,6 +1062,10 @@ static VkResult win32u_vkQueueSubmit( VkQueue client_queue, uint32_t count, cons { switch ((*next)->sType) { + case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: + FIXME( "VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR not implemented!\n" ); + *next = (*next)->pNext; next = &prev; + break; case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: break; case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: break; case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM: break; @@ -1119,6 +1123,74 @@ static VkResult win32u_vkQueueSubmit2( VkQueue client_queue, uint32_t count, con return device->p_vkQueueSubmit2( queue->host.queue, count, submits, fence ); }
+static VkResult win32u_vkCreateSemaphore( VkDevice client_device, const VkSemaphoreCreateInfo *client_create_info, + const VkAllocationCallbacks *allocator, VkSemaphore *ret ) +{ + VkSemaphoreCreateInfo *create_info = (VkSemaphoreCreateInfo *)client_create_info; /* cast away const, chain has been copied in the thunks */ + struct vulkan_device *device = vulkan_device_from_handle( client_device ); + VkBaseOutStructure **next, *prev = (VkBaseOutStructure *)create_info; + + TRACE( "device %p, create_info %p, allocator %p, ret %p\n", device, create_info, allocator, ret ); + + for (next = &prev->pNext; *next; prev = *next, next = &(*next)->pNext) + { + switch ((*next)->sType) + { + case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: + FIXME( "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO not implemented!\n" ); + *next = (*next)->pNext; next = &prev; + break; + case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: + FIXME( "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR not implemented!\n" ); + *next = (*next)->pNext; next = &prev; + break; + case VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV: break; + case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: break; + default: FIXME( "Unhandled sType %u.\n", (*next)->sType ); break; + } + } + + return device->p_vkCreateSemaphore( device->host.device, create_info, NULL /* allocator */, ret ); +} + +static void win32u_vkDestroySemaphore( VkDevice client_device, VkSemaphore client_semaphore, const VkAllocationCallbacks *allocator ) +{ + struct vulkan_device *device = vulkan_device_from_handle( client_device ); + + TRACE( "device %p, client_semaphore %#jx, allocator %p\n", device, client_semaphore, allocator ); + + device->p_vkDestroySemaphore( device->host.device, client_semaphore, NULL /* allocator */ ); +} + +static VkResult win32u_vkGetSemaphoreWin32HandleKHR( VkDevice client_device, const VkSemaphoreGetWin32HandleInfoKHR *handle_info, HANDLE *handle ) +{ + struct vulkan_device *device = vulkan_device_from_handle( client_device ); + + FIXME( "device %p, handle_info %p, handle %p stub!\n", device, handle_info, handle ); + + return VK_ERROR_INCOMPATIBLE_DRIVER; +} + +static VkResult win32u_vkImportSemaphoreWin32HandleKHR( VkDevice client_device, const VkImportSemaphoreWin32HandleInfoKHR *handle_info ) +{ + struct vulkan_device *device = vulkan_device_from_handle( client_device ); + + FIXME( "device %p, handle_info %p stub!\n", device, handle_info ); + + return VK_ERROR_INCOMPATIBLE_DRIVER; +} + +static void win32u_vkGetPhysicalDeviceExternalSemaphoreProperties( VkPhysicalDevice client_physical_device, const VkPhysicalDeviceExternalSemaphoreInfo *semaphore_info, + VkExternalSemaphoreProperties *semaphore_properties ) +{ + struct vulkan_physical_device *physical_device = vulkan_physical_device_from_handle( client_physical_device ); + struct vulkan_instance *instance = physical_device->instance; + + TRACE( "physical_device %p, semaphore_info %p, semaphore_properties %p\n", physical_device, semaphore_info, semaphore_properties ); + + instance->p_vkGetPhysicalDeviceExternalSemaphoreProperties( physical_device->host.physical_device, semaphore_info, semaphore_properties ); +} + static const char *win32u_get_host_surface_extension(void) { return driver_funcs->p_get_host_surface_extension(); @@ -1131,8 +1203,10 @@ static struct vulkan_funcs vulkan_funcs = .p_vkAllocateMemory = win32u_vkAllocateMemory, .p_vkCreateBuffer = win32u_vkCreateBuffer, .p_vkCreateImage = win32u_vkCreateImage, + .p_vkCreateSemaphore = win32u_vkCreateSemaphore, .p_vkCreateSwapchainKHR = win32u_vkCreateSwapchainKHR, .p_vkCreateWin32SurfaceKHR = win32u_vkCreateWin32SurfaceKHR, + .p_vkDestroySemaphore = win32u_vkDestroySemaphore, .p_vkDestroySurfaceKHR = win32u_vkDestroySurfaceKHR, .p_vkDestroySwapchainKHR = win32u_vkDestroySwapchainKHR, .p_vkFreeMemory = win32u_vkFreeMemory, @@ -1143,6 +1217,8 @@ static struct vulkan_funcs vulkan_funcs = .p_vkGetMemoryWin32HandlePropertiesKHR = win32u_vkGetMemoryWin32HandlePropertiesKHR, .p_vkGetPhysicalDeviceExternalBufferProperties = win32u_vkGetPhysicalDeviceExternalBufferProperties, .p_vkGetPhysicalDeviceExternalBufferPropertiesKHR = win32u_vkGetPhysicalDeviceExternalBufferProperties, + .p_vkGetPhysicalDeviceExternalSemaphoreProperties = win32u_vkGetPhysicalDeviceExternalSemaphoreProperties, + .p_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = win32u_vkGetPhysicalDeviceExternalSemaphoreProperties, .p_vkGetPhysicalDeviceImageFormatProperties2 = win32u_vkGetPhysicalDeviceImageFormatProperties2, .p_vkGetPhysicalDeviceImageFormatProperties2KHR = win32u_vkGetPhysicalDeviceImageFormatProperties2, .p_vkGetPhysicalDevicePresentRectanglesKHR = win32u_vkGetPhysicalDevicePresentRectanglesKHR, @@ -1151,6 +1227,8 @@ static struct vulkan_funcs vulkan_funcs = .p_vkGetPhysicalDeviceSurfaceFormats2KHR = win32u_vkGetPhysicalDeviceSurfaceFormats2KHR, .p_vkGetPhysicalDeviceSurfaceFormatsKHR = win32u_vkGetPhysicalDeviceSurfaceFormatsKHR, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = win32u_vkGetPhysicalDeviceWin32PresentationSupportKHR, + .p_vkGetSemaphoreWin32HandleKHR = win32u_vkGetSemaphoreWin32HandleKHR, + .p_vkImportSemaphoreWin32HandleKHR = win32u_vkImportSemaphoreWin32HandleKHR, .p_vkMapMemory = win32u_vkMapMemory, .p_vkMapMemory2KHR = win32u_vkMapMemory2KHR, .p_vkQueuePresentKHR = win32u_vkQueuePresentKHR, diff --git a/dlls/winevulkan/loader_thunks.c b/dlls/winevulkan/loader_thunks.c index 3da89090ee8..0d9dabadb1e 100644 --- a/dlls/winevulkan/loader_thunks.c +++ b/dlls/winevulkan/loader_thunks.c @@ -6206,6 +6206,18 @@ VkResult WINAPI vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semap return params.result; }
+VkResult WINAPI vkGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR *pGetWin32HandleInfo, HANDLE *pHandle) +{ + struct vkGetSemaphoreWin32HandleKHR_params params; + NTSTATUS status; + params.device = device; + params.pGetWin32HandleInfo = pGetWin32HandleInfo; + params.pHandle = pHandle; + status = UNIX_CALL(vkGetSemaphoreWin32HandleKHR, ¶ms); + assert(!status && "vkGetSemaphoreWin32HandleKHR"); + return params.result; +} + VkResult WINAPI vkGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData) { struct vkGetShaderBinaryDataEXT_params params; @@ -6330,6 +6342,17 @@ VkResult WINAPI vkGetVideoSessionMemoryRequirementsKHR(VkDevice device, VkVideoS return params.result; }
+VkResult WINAPI vkImportSemaphoreWin32HandleKHR(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR *pImportSemaphoreWin32HandleInfo) +{ + struct vkImportSemaphoreWin32HandleKHR_params params; + NTSTATUS status; + params.device = device; + params.pImportSemaphoreWin32HandleInfo = pImportSemaphoreWin32HandleInfo; + status = UNIX_CALL(vkImportSemaphoreWin32HandleKHR, ¶ms); + assert(!status && "vkImportSemaphoreWin32HandleKHR"); + return params.result; +} + VkResult WINAPI vkInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL *pInitializeInfo) { struct vkInitializePerformanceApiINTEL_params params; @@ -7598,6 +7621,7 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkGetSamplerOpaqueCaptureDescriptorDataEXT", vkGetSamplerOpaqueCaptureDescriptorDataEXT}, {"vkGetSemaphoreCounterValue", vkGetSemaphoreCounterValue}, {"vkGetSemaphoreCounterValueKHR", vkGetSemaphoreCounterValueKHR}, + {"vkGetSemaphoreWin32HandleKHR", vkGetSemaphoreWin32HandleKHR}, {"vkGetShaderBinaryDataEXT", vkGetShaderBinaryDataEXT}, {"vkGetShaderInfoAMD", vkGetShaderInfoAMD}, {"vkGetShaderModuleCreateInfoIdentifierEXT", vkGetShaderModuleCreateInfoIdentifierEXT}, @@ -7608,6 +7632,7 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkGetTensorViewOpaqueCaptureDescriptorDataARM", vkGetTensorViewOpaqueCaptureDescriptorDataARM}, {"vkGetValidationCacheDataEXT", vkGetValidationCacheDataEXT}, {"vkGetVideoSessionMemoryRequirementsKHR", vkGetVideoSessionMemoryRequirementsKHR}, + {"vkImportSemaphoreWin32HandleKHR", vkImportSemaphoreWin32HandleKHR}, {"vkInitializePerformanceApiINTEL", vkInitializePerformanceApiINTEL}, {"vkInvalidateMappedMemoryRanges", vkInvalidateMappedMemoryRanges}, {"vkLatencySleepNV", vkLatencySleepNV}, diff --git a/dlls/winevulkan/loader_thunks.h b/dlls/winevulkan/loader_thunks.h index ebfc3dce3a8..c896017888e 100644 --- a/dlls/winevulkan/loader_thunks.h +++ b/dlls/winevulkan/loader_thunks.h @@ -609,6 +609,7 @@ enum unix_call unix_vkGetSamplerOpaqueCaptureDescriptorDataEXT, unix_vkGetSemaphoreCounterValue, unix_vkGetSemaphoreCounterValueKHR, + unix_vkGetSemaphoreWin32HandleKHR, unix_vkGetShaderBinaryDataEXT, unix_vkGetShaderInfoAMD, unix_vkGetShaderModuleCreateInfoIdentifierEXT, @@ -619,6 +620,7 @@ enum unix_call unix_vkGetTensorViewOpaqueCaptureDescriptorDataARM, unix_vkGetValidationCacheDataEXT, unix_vkGetVideoSessionMemoryRequirementsKHR, + unix_vkImportSemaphoreWin32HandleKHR, unix_vkInitializePerformanceApiINTEL, unix_vkInvalidateMappedMemoryRanges, unix_vkLatencySleepNV, @@ -5205,6 +5207,14 @@ struct vkGetSemaphoreCounterValueKHR_params VkResult result; };
+struct vkGetSemaphoreWin32HandleKHR_params +{ + VkDevice device; + const VkSemaphoreGetWin32HandleInfoKHR *pGetWin32HandleInfo; + HANDLE *pHandle; + VkResult result; +}; + struct vkGetShaderBinaryDataEXT_params { VkDevice device; @@ -5289,6 +5299,13 @@ struct vkGetVideoSessionMemoryRequirementsKHR_params VkResult result; };
+struct vkImportSemaphoreWin32HandleKHR_params +{ + VkDevice device; + const VkImportSemaphoreWin32HandleInfoKHR *pImportSemaphoreWin32HandleInfo; + VkResult result; +}; + struct vkInitializePerformanceApiINTEL_params { VkDevice device; diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 47b3acef9cc..afe4abd3043 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -97,7 +97,6 @@ UNSUPPORTED_EXTENSIONS = [ "VK_EXT_full_screen_exclusive", "VK_GOOGLE_display_timing", "VK_KHR_external_fence_win32", - "VK_KHR_external_semaphore_win32", # Relates to external_semaphore and needs type conversions in bitflags. "VK_KHR_maintenance7", # Causes infinity recursion in struct convert code "VK_KHR_shared_presentable_image", # Needs WSI work. @@ -190,7 +189,6 @@ FUNCTION_OVERRIDES = { # Instance functions "vkCreateDevice" : {"extra_param" : "client_ptr"}, "vkGetPhysicalDeviceExternalFenceProperties" : {"dispatch" : False}, - "vkGetPhysicalDeviceExternalSemaphoreProperties" : {"dispatch" : False},
# Device functions "vkCreateCommandPool" : {"extra_param" : "client_ptr"}, @@ -198,9 +196,6 @@ FUNCTION_OVERRIDES = {
# VK_KHR_external_fence_capabilities "vkGetPhysicalDeviceExternalFencePropertiesKHR" : {"dispatch" : False}, - - # VK_KHR_external_semaphore_capabilities - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" : {"dispatch" : False}, }
# functions for which a user driver entry must be generated @@ -210,8 +205,10 @@ USER_DRIVER_FUNCS = { "vkAllocateMemory", "vkCreateBuffer", "vkCreateImage", + "vkCreateSemaphore", "vkCreateSwapchainKHR", "vkCreateWin32SurfaceKHR", + "vkDestroySemaphore", "vkDestroySurfaceKHR", "vkDestroySwapchainKHR", "vkFreeMemory", @@ -224,6 +221,8 @@ USER_DRIVER_FUNCS = { "vkGetMemoryWin32HandlePropertiesKHR", "vkGetPhysicalDeviceExternalBufferProperties", "vkGetPhysicalDeviceExternalBufferPropertiesKHR", + "vkGetPhysicalDeviceExternalSemaphoreProperties", + "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR", "vkGetPhysicalDeviceImageFormatProperties2", "vkGetPhysicalDeviceImageFormatProperties2KHR", "vkGetPhysicalDevicePresentRectanglesKHR", @@ -232,6 +231,8 @@ USER_DRIVER_FUNCS = { "vkGetPhysicalDeviceSurfaceFormats2KHR", "vkGetPhysicalDeviceSurfaceFormatsKHR", "vkGetPhysicalDeviceWin32PresentationSupportKHR", + "vkGetSemaphoreWin32HandleKHR", + "vkImportSemaphoreWin32HandleKHR", "vkMapMemory", "vkMapMemory2KHR", "vkQueuePresentKHR", @@ -276,8 +277,6 @@ MANUAL_UNIX_THUNKS = { "vkGetPhysicalDeviceCalibrateableTimeDomainsKHR", "vkGetPhysicalDeviceExternalFenceProperties", "vkGetPhysicalDeviceExternalFencePropertiesKHR", - "vkGetPhysicalDeviceExternalSemaphoreProperties", - "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR", }
# loader functions which are entirely manually implemented @@ -311,6 +310,7 @@ STRUCT_CHAIN_CONVERSIONS = { "VkPhysicalDeviceExternalBufferInfo": {}, "VkPhysicalDeviceImageFormatInfo2": {}, "VkCommandBufferSubmitInfo": {}, + "VkSemaphoreCreateInfo": {}, "VkSubmitInfo": {}, "VkSubmitInfo2": {},
diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 7d2ddc5be4c..61c85dbd940 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -2484,6 +2484,16 @@ typedef struct VkCuModuleTexturingModeCreateInfoNVX32 VkBool32 use64bitTexturing; } VkCuModuleTexturingModeCreateInfoNVX32;
+typedef struct VkD3D12FenceSubmitInfoKHR32 +{ + VkStructureType sType; + PTR32 pNext; + uint32_t waitSemaphoreValuesCount; + PTR32 pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + PTR32 pSignalSemaphoreValues; +} VkD3D12FenceSubmitInfoKHR32; + typedef struct VkDataGraphPipelineCompilerControlCreateInfoARM32 { VkStructureType sType; @@ -3119,6 +3129,15 @@ typedef struct VkExportSemaphoreCreateInfo32 } VkExportSemaphoreCreateInfo32; typedef VkExportSemaphoreCreateInfo32 VkExportSemaphoreCreateInfoKHR32;
+typedef struct VkExportSemaphoreWin32HandleInfoKHR32 +{ + VkStructureType sType; + PTR32 pNext; + PTR32 pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportSemaphoreWin32HandleInfoKHR32; + typedef struct VkExternalBufferProperties32 { VkStructureType sType; @@ -3641,6 +3660,17 @@ typedef struct VkImportMemoryWin32HandleInfoKHR32 LPCWSTR name; } VkImportMemoryWin32HandleInfoKHR32;
+typedef struct VkImportSemaphoreWin32HandleInfoKHR32 +{ + VkStructureType sType; + PTR32 pNext; + VkSemaphore DECLSPEC_ALIGN(8) semaphore; + VkSemaphoreImportFlags flags; + VkExternalSemaphoreHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportSemaphoreWin32HandleInfoKHR32; + typedef struct VkIndirectCommandsLayoutCreateInfoEXT32 { VkStructureType sType; @@ -8303,6 +8333,14 @@ typedef struct VkSemaphoreCreateInfo32 VkSemaphoreCreateFlags flags; } VkSemaphoreCreateInfo32;
+typedef struct VkSemaphoreGetWin32HandleInfoKHR32 +{ + VkStructureType sType; + PTR32 pNext; + VkSemaphore DECLSPEC_ALIGN(8) semaphore; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkSemaphoreGetWin32HandleInfoKHR32; + typedef struct VkSemaphoreSignalInfo32 { VkStructureType sType; @@ -25940,6 +25978,77 @@ static void convert_VkSamplerYcbcrConversionCreateInfo_win32_to_host(struct conv } }
+#ifdef _WIN64 +static void convert_VkSemaphoreCreateInfo_win64_to_host(struct conversion_context *ctx, const VkSemaphoreCreateInfo *in, VkSemaphoreCreateInfo *out) +{ + const VkBaseInStructure *in_header; + VkBaseOutStructure *out_header = (void *)out; + + if (!in) return; + + out->sType = in->sType; + out->pNext = NULL; + out->flags = in->flags; + + for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) + { + switch (in_header->sType) + { + case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: + { + VkExportSemaphoreCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkExportSemaphoreCreateInfo *in_ext = (const VkExportSemaphoreCreateInfo *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO; + out_ext->pNext = NULL; + out_ext->handleTypes = in_ext->handleTypes; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: + { + VkExportSemaphoreWin32HandleInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkExportSemaphoreWin32HandleInfoKHR *in_ext = (const VkExportSemaphoreWin32HandleInfoKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR; + out_ext->pNext = NULL; + out_ext->pAttributes = in_ext->pAttributes; + out_ext->dwAccess = in_ext->dwAccess; + out_ext->name = in_ext->name; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV: + { + VkQueryLowLatencySupportNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkQueryLowLatencySupportNV *in_ext = (const VkQueryLowLatencySupportNV *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV; + out_ext->pNext = NULL; + out_ext->pQueriedLowLatencyData = in_ext->pQueriedLowLatencyData; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: + { + VkSemaphoreTypeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkSemaphoreTypeCreateInfo *in_ext = (const VkSemaphoreTypeCreateInfo *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; + out_ext->pNext = NULL; + out_ext->semaphoreType = in_ext->semaphoreType; + out_ext->initialValue = in_ext->initialValue; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + default: + FIXME("Unhandled sType %u.\n", in_header->sType); + break; + } + } +} +#endif /* _WIN64 */ + static void convert_VkSemaphoreCreateInfo_win32_to_host(struct conversion_context *ctx, const VkSemaphoreCreateInfo32 *in, VkSemaphoreCreateInfo *out) { const VkBaseInStructure32 *in_header; @@ -25966,6 +26075,19 @@ static void convert_VkSemaphoreCreateInfo_win32_to_host(struct conversion_contex out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: + { + VkExportSemaphoreWin32HandleInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkExportSemaphoreWin32HandleInfoKHR32 *in_ext = (const VkExportSemaphoreWin32HandleInfoKHR32 *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR; + out_ext->pNext = NULL; + out_ext->pAttributes = UlongToPtr(in_ext->pAttributes); + out_ext->dwAccess = in_ext->dwAccess; + out_ext->name = in_ext->name; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV: { VkQueryLowLatencySupportNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -38729,6 +38851,18 @@ static void convert_VkSamplerCaptureDescriptorDataInfoEXT_win32_to_host(const Vk FIXME("Unexpected pNext\n"); }
+static void convert_VkSemaphoreGetWin32HandleInfoKHR_win32_to_host(const VkSemaphoreGetWin32HandleInfoKHR32 *in, VkSemaphoreGetWin32HandleInfoKHR *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = NULL; + out->semaphore = in->semaphore; + out->handleType = in->handleType; + if (in->pNext) + FIXME("Unexpected pNext\n"); +} + static void convert_VkShaderModuleIdentifierEXT_win32_to_host(const VkShaderModuleIdentifierEXT32 *in, VkShaderModuleIdentifierEXT *out) { if (!in) return; @@ -38826,6 +38960,21 @@ static void convert_VkVideoSessionMemoryRequirementsKHR_array_host_to_win32(cons } }
+static void convert_VkImportSemaphoreWin32HandleInfoKHR_win32_to_host(const VkImportSemaphoreWin32HandleInfoKHR32 *in, VkImportSemaphoreWin32HandleInfoKHR *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = NULL; + out->semaphore = in->semaphore; + out->flags = in->flags; + out->handleType = in->handleType; + out->handle = in->handle; + out->name = in->name; + if (in->pNext) + FIXME("Unexpected pNext\n"); +} + static void convert_VkInitializePerformanceApiInfoINTEL_win32_to_host(const VkInitializePerformanceApiInfoINTEL32 *in, VkInitializePerformanceApiInfoINTEL *out) { if (!in) return; @@ -39587,6 +39736,20 @@ static void convert_VkSubmitInfo_win64_to_unwrapped_host(struct conversion_conte { switch (in_header->sType) { + case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: + { + VkD3D12FenceSubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkD3D12FenceSubmitInfoKHR *in_ext = (const VkD3D12FenceSubmitInfoKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR; + out_ext->pNext = NULL; + out_ext->waitSemaphoreValuesCount = in_ext->waitSemaphoreValuesCount; + out_ext->pWaitSemaphoreValues = in_ext->pWaitSemaphoreValues; + out_ext->signalSemaphoreValuesCount = in_ext->signalSemaphoreValuesCount; + out_ext->pSignalSemaphoreValues = in_ext->pSignalSemaphoreValues; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: { VkDeviceGroupSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -39761,6 +39924,20 @@ static void convert_VkSubmitInfo_win32_to_unwrapped_host(struct conversion_conte { switch (in_header->sType) { + case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: + { + VkD3D12FenceSubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkD3D12FenceSubmitInfoKHR32 *in_ext = (const VkD3D12FenceSubmitInfoKHR32 *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR; + out_ext->pNext = NULL; + out_ext->waitSemaphoreValuesCount = in_ext->waitSemaphoreValuesCount; + out_ext->pWaitSemaphoreValues = UlongToPtr(in_ext->pWaitSemaphoreValues); + out_ext->signalSemaphoreValuesCount = in_ext->signalSemaphoreValuesCount; + out_ext->pSignalSemaphoreValues = UlongToPtr(in_ext->pSignalSemaphoreValues); + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: { VkDeviceGroupSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -50004,10 +50181,16 @@ static NTSTATUS thunk32_vkCreateSamplerYcbcrConversionKHR(void *args) static NTSTATUS thunk64_vkCreateSemaphore(void *args) { struct vkCreateSemaphore_params *params = args; + VkSemaphoreCreateInfo pCreateInfo_host; + struct conversion_context local_ctx; + struct conversion_context *ctx = &local_ctx;
TRACE("%p, %p, %p, %p\n", params->device, params->pCreateInfo, params->pAllocator, params->pSemaphore);
- params->result = vulkan_device_from_handle(params->device)->p_vkCreateSemaphore(vulkan_device_from_handle(params->device)->host.device, params->pCreateInfo, NULL, params->pSemaphore); + init_conversion_context(ctx); + convert_VkSemaphoreCreateInfo_win64_to_host(ctx, params->pCreateInfo, &pCreateInfo_host); + params->result = vk_funcs->p_vkCreateSemaphore(params->device, &pCreateInfo_host, params->pAllocator, params->pSemaphore); + free_conversion_context(ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -50030,7 +50213,7 @@ static NTSTATUS thunk32_vkCreateSemaphore(void *args)
init_conversion_context(ctx); convert_VkSemaphoreCreateInfo_win32_to_host(ctx, (const VkSemaphoreCreateInfo32 *)UlongToPtr(params->pCreateInfo), &pCreateInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkCreateSemaphore(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, &pCreateInfo_host, NULL, (VkSemaphore *)UlongToPtr(params->pSemaphore)); + params->result = vk_funcs->p_vkCreateSemaphore((VkDevice)UlongToPtr(params->device), &pCreateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkSemaphore *)UlongToPtr(params->pSemaphore)); free_conversion_context(ctx); return STATUS_SUCCESS; } @@ -51507,7 +51690,7 @@ static NTSTATUS thunk64_vkDestroySemaphore(void *args)
TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pAllocator);
- vulkan_device_from_handle(params->device)->p_vkDestroySemaphore(vulkan_device_from_handle(params->device)->host.device, params->semaphore, NULL); + vk_funcs->p_vkDestroySemaphore(params->device, params->semaphore, params->pAllocator); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -51523,7 +51706,7 @@ static NTSTATUS thunk32_vkDestroySemaphore(void *args)
TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->semaphore), params->pAllocator);
- vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkDestroySemaphore(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, params->semaphore, NULL); + vk_funcs->p_vkDestroySemaphore((VkDevice)UlongToPtr(params->device), params->semaphore, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); return STATUS_SUCCESS; }
@@ -55263,7 +55446,7 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphoreProperties(void *arg
TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties);
- wine_vkGetPhysicalDeviceExternalSemaphoreProperties(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); + vk_funcs->p_vkGetPhysicalDeviceExternalSemaphoreProperties(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -55286,7 +55469,7 @@ static NTSTATUS thunk32_vkGetPhysicalDeviceExternalSemaphoreProperties(void *arg init_conversion_context(ctx); convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalSemaphoreInfo32 *)UlongToPtr(params->pExternalSemaphoreInfo), &pExternalSemaphoreInfo_host); convert_VkExternalSemaphoreProperties_win32_to_host((VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties), &pExternalSemaphoreProperties_host); - wine_vkGetPhysicalDeviceExternalSemaphoreProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); + vk_funcs->p_vkGetPhysicalDeviceExternalSemaphoreProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); convert_VkExternalSemaphoreProperties_host_to_win32(&pExternalSemaphoreProperties_host, (VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties)); free_conversion_context(ctx); return STATUS_SUCCESS; @@ -55299,7 +55482,7 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(void *
TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties);
- wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); + vk_funcs->p_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -55322,7 +55505,7 @@ static NTSTATUS thunk32_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(void * init_conversion_context(ctx); convert_VkPhysicalDeviceExternalSemaphoreInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalSemaphoreInfo32 *)UlongToPtr(params->pExternalSemaphoreInfo), &pExternalSemaphoreInfo_host); convert_VkExternalSemaphoreProperties_win32_to_host((VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties), &pExternalSemaphoreProperties_host); - wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); + vk_funcs->p_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalSemaphoreInfo_host, &pExternalSemaphoreProperties_host); convert_VkExternalSemaphoreProperties_host_to_win32(&pExternalSemaphoreProperties_host, (VkExternalSemaphoreProperties32 *)UlongToPtr(params->pExternalSemaphoreProperties)); free_conversion_context(ctx); return STATUS_SUCCESS; @@ -57502,6 +57685,36 @@ static NTSTATUS thunk32_vkGetSemaphoreCounterValueKHR(void *args) return STATUS_SUCCESS; }
+#ifdef _WIN64 +static NTSTATUS thunk64_vkGetSemaphoreWin32HandleKHR(void *args) +{ + struct vkGetSemaphoreWin32HandleKHR_params *params = args; + + TRACE("%p, %p, %p\n", params->device, params->pGetWin32HandleInfo, params->pHandle); + + params->result = vk_funcs->p_vkGetSemaphoreWin32HandleKHR(params->device, params->pGetWin32HandleInfo, params->pHandle); + return STATUS_SUCCESS; +} +#endif /* _WIN64 */ + +static NTSTATUS thunk32_vkGetSemaphoreWin32HandleKHR(void *args) +{ + struct + { + PTR32 device; + PTR32 pGetWin32HandleInfo; + PTR32 pHandle; + VkResult result; + } *params = args; + VkSemaphoreGetWin32HandleInfoKHR pGetWin32HandleInfo_host; + + TRACE("%#x, %#x, %#x\n", params->device, params->pGetWin32HandleInfo, params->pHandle); + + convert_VkSemaphoreGetWin32HandleInfoKHR_win32_to_host((const VkSemaphoreGetWin32HandleInfoKHR32 *)UlongToPtr(params->pGetWin32HandleInfo), &pGetWin32HandleInfo_host); + params->result = vk_funcs->p_vkGetSemaphoreWin32HandleKHR((VkDevice)UlongToPtr(params->device), &pGetWin32HandleInfo_host, (HANDLE *)UlongToPtr(params->pHandle)); + return STATUS_SUCCESS; +} + #ifdef _WIN64 static NTSTATUS thunk64_vkGetShaderBinaryDataEXT(void *args) { @@ -57827,6 +58040,35 @@ static NTSTATUS thunk32_vkGetVideoSessionMemoryRequirementsKHR(void *args) return STATUS_SUCCESS; }
+#ifdef _WIN64 +static NTSTATUS thunk64_vkImportSemaphoreWin32HandleKHR(void *args) +{ + struct vkImportSemaphoreWin32HandleKHR_params *params = args; + + TRACE("%p, %p\n", params->device, params->pImportSemaphoreWin32HandleInfo); + + params->result = vk_funcs->p_vkImportSemaphoreWin32HandleKHR(params->device, params->pImportSemaphoreWin32HandleInfo); + return STATUS_SUCCESS; +} +#endif /* _WIN64 */ + +static NTSTATUS thunk32_vkImportSemaphoreWin32HandleKHR(void *args) +{ + struct + { + PTR32 device; + PTR32 pImportSemaphoreWin32HandleInfo; + VkResult result; + } *params = args; + VkImportSemaphoreWin32HandleInfoKHR pImportSemaphoreWin32HandleInfo_host; + + TRACE("%#x, %#x\n", params->device, params->pImportSemaphoreWin32HandleInfo); + + convert_VkImportSemaphoreWin32HandleInfoKHR_win32_to_host((const VkImportSemaphoreWin32HandleInfoKHR32 *)UlongToPtr(params->pImportSemaphoreWin32HandleInfo), &pImportSemaphoreWin32HandleInfo_host); + params->result = vk_funcs->p_vkImportSemaphoreWin32HandleKHR((VkDevice)UlongToPtr(params->device), &pImportSemaphoreWin32HandleInfo_host); + return STATUS_SUCCESS; +} + #ifdef _WIN64 static NTSTATUS thunk64_vkInitializePerformanceApiINTEL(void *args) { @@ -59975,6 +60217,7 @@ static const char * const vk_device_extensions[] = "VK_KHR_external_memory", "VK_KHR_external_memory_win32", "VK_KHR_external_semaphore", + "VK_KHR_external_semaphore_win32", "VK_KHR_format_feature_flags2", "VK_KHR_fragment_shader_barycentric", "VK_KHR_fragment_shading_rate", @@ -60817,6 +61060,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = thunk64_vkGetSamplerOpaqueCaptureDescriptorDataEXT, thunk64_vkGetSemaphoreCounterValue, thunk64_vkGetSemaphoreCounterValueKHR, + thunk64_vkGetSemaphoreWin32HandleKHR, thunk64_vkGetShaderBinaryDataEXT, thunk64_vkGetShaderInfoAMD, thunk64_vkGetShaderModuleCreateInfoIdentifierEXT, @@ -60827,6 +61071,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = thunk64_vkGetTensorViewOpaqueCaptureDescriptorDataARM, thunk64_vkGetValidationCacheDataEXT, thunk64_vkGetVideoSessionMemoryRequirementsKHR, + thunk64_vkImportSemaphoreWin32HandleKHR, thunk64_vkInitializePerformanceApiINTEL, thunk64_vkInvalidateMappedMemoryRanges, thunk64_vkLatencySleepNV, @@ -61491,6 +61736,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = thunk32_vkGetSamplerOpaqueCaptureDescriptorDataEXT, thunk32_vkGetSemaphoreCounterValue, thunk32_vkGetSemaphoreCounterValueKHR, + thunk32_vkGetSemaphoreWin32HandleKHR, thunk32_vkGetShaderBinaryDataEXT, thunk32_vkGetShaderInfoAMD, thunk32_vkGetShaderModuleCreateInfoIdentifierEXT, @@ -61501,6 +61747,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = thunk32_vkGetTensorViewOpaqueCaptureDescriptorDataARM, thunk32_vkGetValidationCacheDataEXT, thunk32_vkGetVideoSessionMemoryRequirementsKHR, + thunk32_vkImportSemaphoreWin32HandleKHR, thunk32_vkInitializePerformanceApiINTEL, thunk32_vkInvalidateMappedMemoryRanges, thunk32_vkLatencySleepNV, diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index a7736bb7923..6c0c704355d 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -50,7 +50,5 @@ VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice ph VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainKHR *pTimeDomains); void wine_vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); void wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo *pExternalFenceInfo, VkExternalFenceProperties *pExternalFenceProperties); -void wine_vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties); -void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo, VkExternalSemaphoreProperties *pExternalSemaphoreProperties);
#endif /* __WINE_VULKAN_THUNKS_H */ diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index d156dca58c1..662318acc92 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -186,6 +186,8 @@ typedef struct _XDisplay Display; #define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_semaphore_capabilities" #define VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHR_external_semaphore" +#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 +#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32" #define VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME "VK_KHR_external_semaphore_fd" #define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 2 @@ -5456,6 +5458,10 @@ typedef enum VkStructureType VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = 1000076000, VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = 1000076001, VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = 1000077000, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078000, + VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = 1000078001, + VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR = 1000078002, + VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR = 1000078003, VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR = 1000079000, VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR = 1000079001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES = 1000080000, @@ -11289,6 +11295,16 @@ typedef struct VkCuModuleTexturingModeCreateInfoNVX VkBool32 use64bitTexturing; } VkCuModuleTexturingModeCreateInfoNVX;
+typedef struct VkD3D12FenceSubmitInfoKHR +{ + VkStructureType sType; + const void *pNext; + uint32_t waitSemaphoreValuesCount; + const uint64_t *pWaitSemaphoreValues; + uint32_t signalSemaphoreValuesCount; + const uint64_t *pSignalSemaphoreValues; +} VkD3D12FenceSubmitInfoKHR; + typedef struct VkDataGraphPipelineCompilerControlCreateInfoARM { VkStructureType sType; @@ -11999,6 +12015,15 @@ typedef struct VkExportSemaphoreCreateInfo } VkExportSemaphoreCreateInfo; typedef VkExportSemaphoreCreateInfo VkExportSemaphoreCreateInfoKHR;
+typedef struct VkExportSemaphoreWin32HandleInfoKHR +{ + VkStructureType sType; + const void *pNext; + const SECURITY_ATTRIBUTES *pAttributes; + DWORD dwAccess; + LPCWSTR name; +} VkExportSemaphoreWin32HandleInfoKHR; + typedef struct VkExternalBufferProperties { VkStructureType sType; @@ -12622,6 +12647,17 @@ typedef struct VkImportSemaphoreFdInfoKHR int fd; } VkImportSemaphoreFdInfoKHR;
+typedef struct VkImportSemaphoreWin32HandleInfoKHR +{ + VkStructureType sType; + const void *pNext; + VkSemaphore WINE_VK_ALIGN(8) semaphore; + VkSemaphoreImportFlags flags; + VkExternalSemaphoreHandleTypeFlagBits handleType; + HANDLE handle; + LPCWSTR name; +} VkImportSemaphoreWin32HandleInfoKHR; + typedef struct VkIndirectCommandsLayoutCreateInfoEXT { VkStructureType sType; @@ -17451,6 +17487,14 @@ typedef struct VkSemaphoreGetFdInfoKHR VkExternalSemaphoreHandleTypeFlagBits handleType; } VkSemaphoreGetFdInfoKHR;
+typedef struct VkSemaphoreGetWin32HandleInfoKHR +{ + VkStructureType sType; + const void *pNext; + VkSemaphore WINE_VK_ALIGN(8) semaphore; + VkExternalSemaphoreHandleTypeFlagBits handleType; +} VkSemaphoreGetWin32HandleInfoKHR; + typedef struct VkSemaphoreSignalInfo { VkStructureType sType; @@ -19338,6 +19382,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT)(VkD typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreCounterValue)(VkDevice, VkSemaphore, uint64_t *); typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreCounterValueKHR)(VkDevice, VkSemaphore, uint64_t *); typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreFdKHR)(VkDevice, const VkSemaphoreGetFdInfoKHR *, int *); +typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice, const VkSemaphoreGetWin32HandleInfoKHR *, HANDLE *); typedef VkResult (VKAPI_PTR *PFN_vkGetShaderBinaryDataEXT)(VkDevice, VkShaderEXT, size_t *, void *); typedef VkResult (VKAPI_PTR *PFN_vkGetShaderInfoAMD)(VkDevice, VkPipeline, VkShaderStageFlagBits, VkShaderInfoTypeAMD, size_t *, void *); typedef void (VKAPI_PTR *PFN_vkGetShaderModuleCreateInfoIdentifierEXT)(VkDevice, const VkShaderModuleCreateInfo *, VkShaderModuleIdentifierEXT *); @@ -19350,6 +19395,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetValidationCacheDataEXT)(VkDevice, VkValida typedef VkResult (VKAPI_PTR *PFN_vkGetVideoSessionMemoryRequirementsKHR)(VkDevice, VkVideoSessionKHR, uint32_t *, VkVideoSessionMemoryRequirementsKHR *); typedef VkResult (VKAPI_PTR *PFN_vkImportFenceFdKHR)(VkDevice, const VkImportFenceFdInfoKHR *); typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreFdKHR)(VkDevice, const VkImportSemaphoreFdInfoKHR *); +typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice, const VkImportSemaphoreWin32HandleInfoKHR *); typedef VkResult (VKAPI_PTR *PFN_vkInitializePerformanceApiINTEL)(VkDevice, const VkInitializePerformanceApiInfoINTEL *); typedef VkResult (VKAPI_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice, uint32_t, const VkMappedMemoryRange *); typedef VkResult (VKAPI_PTR *PFN_vkLatencySleepNV)(VkDevice, VkSwapchainKHR, const VkLatencySleepInfoNV *); @@ -20019,6 +20065,7 @@ VkResult VKAPI_CALL vkGetSamplerOpaqueCaptureDescriptorDataEXT(VkDevice device, VkResult VKAPI_CALL vkGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t *pValue); VkResult VKAPI_CALL vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t *pValue); VkResult VKAPI_CALL vkGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR *pGetFdInfo, int *pFd); +VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR *pGetWin32HandleInfo, HANDLE *pHandle); VkResult VKAPI_CALL vkGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData); VkResult VKAPI_CALL vkGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t *pInfoSize, void *pInfo); void VKAPI_CALL vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, VkShaderModuleIdentifierEXT *pIdentifier); @@ -20031,6 +20078,7 @@ VkResult VKAPI_CALL vkGetValidationCacheDataEXT(VkDevice device, VkValidationCac VkResult VKAPI_CALL vkGetVideoSessionMemoryRequirementsKHR(VkDevice device, VkVideoSessionKHR videoSession, uint32_t *pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR *pMemoryRequirements); VkResult VKAPI_CALL vkImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR *pImportFenceFdInfo); VkResult VKAPI_CALL vkImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR *pImportSemaphoreFdInfo); +VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR *pImportSemaphoreWin32HandleInfo); VkResult VKAPI_CALL vkInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL *pInitializeInfo); VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges); VkResult VKAPI_CALL vkLatencySleepNV(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV *pSleepInfo); @@ -20619,6 +20667,7 @@ VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micr USE_VK_FUNC(vkGetSemaphoreCounterValue) \ USE_VK_FUNC(vkGetSemaphoreCounterValueKHR) \ USE_VK_FUNC(vkGetSemaphoreFdKHR) \ + USE_VK_FUNC(vkGetSemaphoreWin32HandleKHR) \ USE_VK_FUNC(vkGetShaderBinaryDataEXT) \ USE_VK_FUNC(vkGetShaderInfoAMD) \ USE_VK_FUNC(vkGetShaderModuleCreateInfoIdentifierEXT) \ @@ -20631,6 +20680,7 @@ VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micr USE_VK_FUNC(vkGetVideoSessionMemoryRequirementsKHR) \ USE_VK_FUNC(vkImportFenceFdKHR) \ USE_VK_FUNC(vkImportSemaphoreFdKHR) \ + USE_VK_FUNC(vkImportSemaphoreWin32HandleKHR) \ USE_VK_FUNC(vkInitializePerformanceApiINTEL) \ USE_VK_FUNC(vkInvalidateMappedMemoryRanges) \ USE_VK_FUNC(vkLatencySleepNV) \ @@ -20725,6 +20775,8 @@ VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micr USE_VK_FUNC(vkGetPhysicalDeviceCooperativeVectorPropertiesNV) \ USE_VK_FUNC(vkGetPhysicalDeviceExternalBufferProperties) \ USE_VK_FUNC(vkGetPhysicalDeviceExternalBufferPropertiesKHR) \ + USE_VK_FUNC(vkGetPhysicalDeviceExternalSemaphoreProperties) \ + USE_VK_FUNC(vkGetPhysicalDeviceExternalSemaphorePropertiesKHR) \ USE_VK_FUNC(vkGetPhysicalDeviceExternalTensorPropertiesARM) \ USE_VK_FUNC(vkGetPhysicalDeviceFeatures) \ USE_VK_FUNC(vkGetPhysicalDeviceFeatures2) \ diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index d3d1ecf0c71..9b5b74c4f2e 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -47,7 +47,7 @@ struct vulkan_client_object #include "wine/rbtree.h"
/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */ -#define WINE_VULKAN_DRIVER_VERSION 42 +#define WINE_VULKAN_DRIVER_VERSION 43
struct vulkan_object { @@ -192,8 +192,10 @@ struct vulkan_funcs PFN_vkAllocateMemory p_vkAllocateMemory; PFN_vkCreateBuffer p_vkCreateBuffer; PFN_vkCreateImage p_vkCreateImage; + PFN_vkCreateSemaphore p_vkCreateSemaphore; PFN_vkCreateSwapchainKHR p_vkCreateSwapchainKHR; PFN_vkCreateWin32SurfaceKHR p_vkCreateWin32SurfaceKHR; + PFN_vkDestroySemaphore p_vkDestroySemaphore; PFN_vkDestroySurfaceKHR p_vkDestroySurfaceKHR; PFN_vkDestroySwapchainKHR p_vkDestroySwapchainKHR; PFN_vkFreeMemory p_vkFreeMemory; @@ -206,6 +208,8 @@ struct vulkan_funcs PFN_vkGetMemoryWin32HandlePropertiesKHR p_vkGetMemoryWin32HandlePropertiesKHR; PFN_vkGetPhysicalDeviceExternalBufferProperties p_vkGetPhysicalDeviceExternalBufferProperties; PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR p_vkGetPhysicalDeviceExternalBufferPropertiesKHR; + PFN_vkGetPhysicalDeviceExternalSemaphoreProperties p_vkGetPhysicalDeviceExternalSemaphoreProperties; + PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR p_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; PFN_vkGetPhysicalDeviceImageFormatProperties2 p_vkGetPhysicalDeviceImageFormatProperties2; PFN_vkGetPhysicalDeviceImageFormatProperties2KHR p_vkGetPhysicalDeviceImageFormatProperties2KHR; PFN_vkGetPhysicalDevicePresentRectanglesKHR p_vkGetPhysicalDevicePresentRectanglesKHR; @@ -214,6 +218,8 @@ struct vulkan_funcs PFN_vkGetPhysicalDeviceSurfaceFormats2KHR p_vkGetPhysicalDeviceSurfaceFormats2KHR; PFN_vkGetPhysicalDeviceSurfaceFormatsKHR p_vkGetPhysicalDeviceSurfaceFormatsKHR; PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR p_vkGetPhysicalDeviceWin32PresentationSupportKHR; + PFN_vkGetSemaphoreWin32HandleKHR p_vkGetSemaphoreWin32HandleKHR; + PFN_vkImportSemaphoreWin32HandleKHR p_vkImportSemaphoreWin32HandleKHR; PFN_vkMapMemory p_vkMapMemory; PFN_vkMapMemory2KHR p_vkMapMemory2KHR; PFN_vkQueuePresentKHR p_vkQueuePresentKHR;