diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py index d5a37ec48..6f75dfed9 100755 --- a/scripts/generate_vk_helpers.py +++ b/scripts/generate_vk_helpers.py @@ -159,6 +159,8 @@ def get_device_cmds(): requires=("VK_USE_PLATFORM_ANDROID_KHR",), ), None, + Cmd("vkGetCalibratedTimestampsEXT", requires=("VK_EXT_calibrated_timestamps",)), + None, Cmd("vkGetPastPresentationTimingGOOGLE"), None, Cmd("vkGetSwapchainCounterEXT", requires=("VK_EXT_display_control",)), @@ -195,6 +197,11 @@ def get_instance_cmds(): Cmd("vkEnumerateDeviceExtensionProperties"), Cmd("vkEnumerateDeviceLayerProperties"), None, + Cmd( + "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", + requires=("VK_EXT_calibrated_timestamps",), + ), + None, Cmd( "vkCreateDisplayPlaneSurfaceKHR", requires=("VK_USE_PLATFORM_DISPLAY_KHR",) ), @@ -244,6 +251,7 @@ INSTANCE_EXTENSIONS_TO_CHECK = [ ] DEVICE_EXTENSIONS_TO_CHECK = [ "VK_KHR_timeline_semaphore", + "VK_EXT_calibrated_timestamps", "VK_EXT_global_priority", "VK_EXT_robustness2", "VK_GOOGLE_display_timing", diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c index b8767b7e9..567a52dea 100644 --- a/src/xrt/auxiliary/vk/vk_bundle_init.c +++ b/src/xrt/auxiliary/vk/vk_bundle_init.c @@ -487,6 +487,7 @@ 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_timeline_semaphore = false; + vk->has_EXT_calibrated_timestamps = false; vk->has_EXT_global_priority = false; vk->has_EXT_robustness2 = false; vk->has_GOOGLE_display_timing = false; @@ -505,6 +506,13 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li } #endif // defined(VK_KHR_timeline_semaphore) +#if defined(VK_EXT_calibrated_timestamps) + if (strcmp(ext, VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME) == 0) { + vk->has_EXT_calibrated_timestamps = true; + continue; + } +#endif // defined(VK_EXT_calibrated_timestamps) + #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_function_loaders.c b/src/xrt/auxiliary/vk/vk_function_loaders.c index 838fce20a..90e2e6b17 100644 --- a/src/xrt/auxiliary/vk/vk_function_loaders.c +++ b/src/xrt/auxiliary/vk/vk_function_loaders.c @@ -84,6 +84,11 @@ vk_get_instance_functions(struct vk_bundle *vk) vk->vkEnumerateDeviceExtensionProperties = GET_INS_PROC(vk, vkEnumerateDeviceExtensionProperties); vk->vkEnumerateDeviceLayerProperties = GET_INS_PROC(vk, vkEnumerateDeviceLayerProperties); +#if defined(VK_EXT_calibrated_timestamps) + vk->vkGetPhysicalDeviceCalibrateableTimeDomainsEXT = GET_INS_PROC(vk, vkGetPhysicalDeviceCalibrateableTimeDomainsEXT); + +#endif // defined(VK_EXT_calibrated_timestamps) + #if defined(VK_USE_PLATFORM_DISPLAY_KHR) vk->vkCreateDisplayPlaneSurfaceKHR = GET_INS_PROC(vk, vkCreateDisplayPlaneSurfaceKHR); vk->vkGetDisplayPlaneCapabilitiesKHR = GET_INS_PROC(vk, vkGetDisplayPlaneCapabilitiesKHR); @@ -283,6 +288,11 @@ vk_get_device_functions(struct vk_bundle *vk) #endif // defined(VK_USE_PLATFORM_ANDROID_KHR) +#if defined(VK_EXT_calibrated_timestamps) + vk->vkGetCalibratedTimestampsEXT = GET_DEV_PROC(vk, vkGetCalibratedTimestampsEXT); + +#endif // defined(VK_EXT_calibrated_timestamps) + vk->vkGetPastPresentationTimingGOOGLE = GET_DEV_PROC(vk, vkGetPastPresentationTimingGOOGLE); #if defined(VK_EXT_display_control) diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index f7e2119c3..0428d58f9 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -86,6 +86,7 @@ struct vk_bundle // beginning of GENERATED device extension code - do not modify - used by scripts bool has_KHR_timeline_semaphore; + bool has_EXT_calibrated_timestamps; bool has_EXT_global_priority; bool has_EXT_robustness2; bool has_GOOGLE_display_timing; @@ -142,6 +143,11 @@ struct vk_bundle PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties; PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties; +#if defined(VK_EXT_calibrated_timestamps) + PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vkGetPhysicalDeviceCalibrateableTimeDomainsEXT; + +#endif // defined(VK_EXT_calibrated_timestamps) + #if defined(VK_USE_PLATFORM_DISPLAY_KHR) PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR; PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR; @@ -332,6 +338,11 @@ struct vk_bundle #endif // defined(VK_USE_PLATFORM_ANDROID_KHR) +#if defined(VK_EXT_calibrated_timestamps) + PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT; + +#endif // defined(VK_EXT_calibrated_timestamps) + PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE; #if defined(VK_EXT_display_control)