From 1d668233ba6aa9288a07cb75b3948ae9afb69bd9 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 5 Feb 2025 22:59:18 +0000 Subject: [PATCH] venus: enable VK_EXT_external_memory_acquire_unmodified if needed When used internally, we have to conditionally enable it behind the app. Fixes: 969cb02de73 ("venus: chain VkExternalMemoryAcquireUnmodifiedEXT for wsi ownership transfers") Signed-off-by: Yiwei Zhang Part-of: --- src/virtio/vulkan/vn_device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c index a21e10a8526..40a2a3a0d72 100644 --- a/src/virtio/vulkan/vn_device.c +++ b/src/virtio/vulkan/vn_device.c @@ -333,6 +333,15 @@ vn_device_fix_create_info(const struct vn_device *dev, extra_exts[extra_count++] = VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME; } + /* see vn_cmd_set_external_acquire_unmodified */ + if (VN_PRESENT_SRC_INTERNAL_LAYOUT != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR && + physical_dev->renderer_extensions + .EXT_external_memory_acquire_unmodified && + !app_exts->EXT_external_memory_acquire_unmodified && has_wsi) { + extra_exts[extra_count++] = + VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXTENSION_NAME; + } + if (app_exts->EXT_device_memory_report) { /* see vn_physical_device_get_native_extensions */ block_exts[block_count++] = VK_EXT_DEVICE_MEMORY_REPORT_EXTENSION_NAME;