From 5289b081c51e3e8d14601708fa61c66c702043f6 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 3 Dec 2021 21:30:38 +0000 Subject: [PATCH] a/vk: Check for VK_KHR_timeline_semaphore --- scripts/generate_vk_helpers.py | 1 + src/xrt/auxiliary/vk/vk_helpers.c | 8 ++++++++ src/xrt/auxiliary/vk/vk_helpers.h | 1 + 3 files changed, 10 insertions(+) diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py index 4ee9f9913..4ba244ea5 100755 --- a/scripts/generate_vk_helpers.py +++ b/scripts/generate_vk_helpers.py @@ -221,6 +221,7 @@ def get_instance_cmds(): EXTENSIONS_TO_CHECK = [ "VK_GOOGLE_display_timing", + "VK_KHR_timeline_semaphore", "VK_EXT_global_priority", "VK_EXT_robustness2", ] diff --git a/src/xrt/auxiliary/vk/vk_helpers.c b/src/xrt/auxiliary/vk/vk_helpers.c index 0007a177f..ff4ea8072 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.c +++ b/src/xrt/auxiliary/vk/vk_helpers.c @@ -1235,6 +1235,7 @@ fill_in_has_extensions(struct vk_bundle *vk, const char **device_extensions, uin // beginning of GENERATED extension code - do not modify - used by scripts // Reset before filling out. vk->has_GOOGLE_display_timing = false; + vk->has_KHR_timeline_semaphore = false; vk->has_EXT_global_priority = false; vk->has_EXT_robustness2 = false; @@ -1248,6 +1249,13 @@ fill_in_has_extensions(struct vk_bundle *vk, const char **device_extensions, uin } #endif // defined(VK_GOOGLE_display_timing) +#if defined(VK_KHR_timeline_semaphore) + if (strcmp(ext, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME) == 0) { + vk->has_KHR_timeline_semaphore = true; + continue; + } +#endif // defined(VK_KHR_timeline_semaphore) + #if defined(VK_EXT_global_priority) if (strcmp(ext, VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME) == 0) { vk->has_EXT_global_priority = true; diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index 9ea902cb1..0958106bc 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -58,6 +58,7 @@ struct vk_bundle // beginning of GENERATED extension code - do not modify - used by scripts bool has_GOOGLE_display_timing; + bool has_KHR_timeline_semaphore; bool has_EXT_global_priority; bool has_EXT_robustness2; // end of GENERATED extension code - do not modify - used by scripts