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,