From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/vulkan.c | 1 + dlls/winevulkan/vulkan.c | 16 ++++++++++++++++ dlls/winevulkan/vulkan_private.h | 1 + dlls/winewayland.drv/vulkan.c | 1 + dlls/winex11.drv/vulkan.c | 1 + 5 files changed, 20 insertions(+)
diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 877091cd590..8f168fd2e07 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1745,6 +1745,7 @@ static const char *nulldrv_get_host_extension( const char *name ) if (!strcmp( name, "VK_KHR_win32_surface" )) return "VK_EXT_headless_surface"; if (!strcmp( name, "VK_KHR_external_memory_win32" )) return "VK_KHR_external_memory_fd"; if (!strcmp( name, "VK_KHR_external_semaphore_win32" )) return "VK_KHR_external_semaphore_fd"; + if (!strcmp( name, "VK_KHR_external_fence_win32" )) return "VK_KHR_external_fence_fd"; return name; }
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 71785d97ca5..04b2085ac9b 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -368,6 +368,7 @@ static VkResult vulkan_physical_device_init(struct vulkan_physical_device *physi { if (!strcmp(host_properties[i].extensionName, vk_funcs->p_get_host_extension("VK_KHR_external_memory_win32")) || !strcmp(host_properties[i].extensionName, vk_funcs->p_get_host_extension("VK_KHR_external_semaphore_win32")) + || !strcmp(host_properties[i].extensionName, vk_funcs->p_get_host_extension("VK_KHR_external_fence_win32")) || wine_vk_device_extension_supported(host_properties[i].extensionName)) { TRACE("Enabling extension '%s' for physical device %p\n", host_properties[i].extensionName, physical_device); @@ -409,6 +410,11 @@ static VkResult vulkan_physical_device_init(struct vulkan_physical_device *physi strcpy(physical_device->extensions[j].extensionName, "VK_KHR_external_semaphore_win32"); physical_device->extensions[j++].specVersion = VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION; } + else if (!strcmp(host_properties[i].extensionName, vk_funcs->p_get_host_extension("VK_KHR_external_fence_win32"))) + { + strcpy(physical_device->extensions[j].extensionName, "VK_KHR_external_fence_win32"); + physical_device->extensions[j++].specVersion = VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION; + } else if (wine_vk_device_extension_supported(host_properties[i].extensionName)) { physical_device->extensions[j] = host_properties[i]; @@ -593,6 +599,11 @@ static VkResult wine_vk_device_convert_create_info(struct vulkan_physical_device device->has_external_semaphore_win32 = true; *extension = vk_funcs->p_get_host_extension("VK_KHR_external_semaphore_win32"); } + if (!strcmp(*extension, "VK_KHR_external_fence_win32")) + { + device->has_external_fence_win32 = true; + *extension = vk_funcs->p_get_host_extension("VK_KHR_external_fence_win32"); + } }
if (physical_device->map_placed_align) @@ -1798,6 +1809,11 @@ static NTSTATUS is_available_device_function(VkDevice handle, const char *name) if (!strcmp(name, "vkImportSemaphoreWin32HandleKHR")) return device->has_external_semaphore_win32;
+ if (!strcmp(name, "vkGetFenceWin32HandleKHR")) + return device->has_external_fence_win32; + if (!strcmp(name, "vkImportFenceWin32HandleKHR")) + return device->has_external_fence_win32; + return !!vk_funcs->p_vkGetDeviceProcAddr(device->obj.host.device, name); }
diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 37aae0ca004..2324e6f8639 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -43,6 +43,7 @@ struct wine_device struct vulkan_device obj; bool has_external_memory_win32; bool has_external_semaphore_win32; + bool has_external_fence_win32; uint64_t queue_count; struct wine_queue queues[]; }; diff --git a/dlls/winewayland.drv/vulkan.c b/dlls/winewayland.drv/vulkan.c index b70d2636df3..9a70c90447d 100644 --- a/dlls/winewayland.drv/vulkan.c +++ b/dlls/winewayland.drv/vulkan.c @@ -86,6 +86,7 @@ static const char *wayland_get_host_extension(const char *name) if (!strcmp( name, "VK_KHR_win32_surface" )) return "VK_KHR_wayland_surface"; if (!strcmp( name, "VK_KHR_external_memory_win32" )) return "VK_KHR_external_memory_fd"; if (!strcmp( name, "VK_KHR_external_semaphore_win32" )) return "VK_KHR_external_semaphore_fd"; + if (!strcmp( name, "VK_KHR_external_fence_win32" )) return "VK_KHR_external_fence_fd"; return name; }
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index a3277bb999b..bb4f5c45eec 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -83,6 +83,7 @@ static const char *X11DRV_get_host_extension( const char *name ) if (!strcmp( name, "VK_KHR_win32_surface" )) return "VK_KHR_xlib_surface"; if (!strcmp( name, "VK_KHR_external_memory_win32" )) return "VK_KHR_external_memory_fd"; if (!strcmp( name, "VK_KHR_external_semaphore_win32" )) return "VK_KHR_external_semaphore_fd"; + if (!strcmp( name, "VK_KHR_external_fence_win32" )) return "VK_KHR_external_fence_fd"; return name; }