From c35b52638c52925db893c9ba15b836e99d7e8674 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Fri, 28 Feb 2025 14:48:12 -0800 Subject: [PATCH] venus: relax the requirement for sync2 The current requirement for sync is only to support WSI, and it is not necessarily needed at all per the comment added. Will drop it later. Cc: mesa-stable Signed-off-by: Yiwei Zhang Part-of: --- src/virtio/vulkan/vn_physical_device.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/virtio/vulkan/vn_physical_device.c b/src/virtio/vulkan/vn_physical_device.c index 27235d83192..73102ce020c 100644 --- a/src/virtio/vulkan/vn_physical_device.c +++ b/src/virtio/vulkan/vn_physical_device.c @@ -1101,6 +1101,17 @@ vn_physical_device_get_passthrough_extensions( { struct vn_renderer *renderer = physical_dev->instance->renderer; +#if DETECT_OS_ANDROID || defined(VN_USE_WSI_PLATFORM) + /* WSI support currently requires semaphore sync fd import for + * VK_KHR_synchronization2 for code simplicity. This requirement can be + * dropped by implementing external semaphore purely on the driver side + * (aka no corresponding renderer side object). + */ + const bool can_sync2 = physical_dev->renderer_sync_fd.semaphore_importable; +#else + static const bool can_sync2 = true; +#endif + *exts = (struct vk_device_extension_table){ /* promoted to VK_VERSION_1_1 */ .KHR_16bit_storage = true, @@ -1156,11 +1167,7 @@ vn_physical_device_get_passthrough_extensions( .KHR_shader_integer_dot_product = true, .KHR_shader_non_semantic_info = true, .KHR_shader_terminate_invocation = true, - /* Our implementation requires semaphore sync fd import - * for VK_KHR_synchronization2. - */ - .KHR_synchronization2 = - physical_dev->renderer_sync_fd.semaphore_importable, + .KHR_synchronization2 = can_sync2, .KHR_zero_initialize_workgroup_memory = true, .EXT_4444_formats = true, .EXT_extended_dynamic_state = true,