From 6a8e679f873cc7cc89d131980b29521b077263b2 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 8 May 2022 12:55:48 +0100 Subject: [PATCH] a/vk: Check for VK_KHR_external_fence_fd and VK_KHR_external_semaphore_fd --- scripts/generate_vk_helpers.py | 2 ++ src/xrt/auxiliary/vk/vk_bundle_init.c | 16 ++++++++++++++++ src/xrt/auxiliary/vk/vk_helpers.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py index 7c074c724..43e4ff6a5 100755 --- a/scripts/generate_vk_helpers.py +++ b/scripts/generate_vk_helpers.py @@ -252,6 +252,8 @@ INSTANCE_EXTENSIONS_TO_CHECK = [ ] # Sorted KHR, EXT, Vendor, interally alphabetically DEVICE_EXTENSIONS_TO_CHECK = [ + "VK_KHR_external_fence_fd", + "VK_KHR_external_semaphore_fd", "VK_KHR_timeline_semaphore", "VK_EXT_calibrated_timestamps", "VK_EXT_display_control", diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c index c09b661db..aaa47efe0 100644 --- a/src/xrt/auxiliary/vk/vk_bundle_init.c +++ b/src/xrt/auxiliary/vk/vk_bundle_init.c @@ -516,6 +516,8 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li { // beginning of GENERATED device extension code - do not modify - used by scripts // Reset before filling out. + vk->has_KHR_external_fence_fd = false; + vk->has_KHR_external_semaphore_fd = false; vk->has_KHR_timeline_semaphore = false; vk->has_EXT_calibrated_timestamps = false; vk->has_EXT_display_control = false; @@ -529,6 +531,20 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li for (uint32_t i = 0; i < ext_count; i++) { const char *ext = exts[i]; +#if defined(VK_KHR_external_fence_fd) + if (strcmp(ext, VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME) == 0) { + vk->has_KHR_external_fence_fd = true; + continue; + } +#endif // defined(VK_KHR_external_fence_fd) + +#if defined(VK_KHR_external_semaphore_fd) + if (strcmp(ext, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME) == 0) { + vk->has_KHR_external_semaphore_fd = true; + continue; + } +#endif // defined(VK_KHR_external_semaphore_fd) + #if defined(VK_KHR_timeline_semaphore) if (strcmp(ext, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME) == 0) { vk->has_KHR_timeline_semaphore = true; diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index 34c5342e1..4d7f1b95c 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -85,6 +85,8 @@ struct vk_bundle // end of GENERATED instance extension code - do not modify - used by scripts // beginning of GENERATED device extension code - do not modify - used by scripts + bool has_KHR_external_fence_fd; + bool has_KHR_external_semaphore_fd; bool has_KHR_timeline_semaphore; bool has_EXT_calibrated_timestamps; bool has_EXT_display_control;