diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py index 059bc5509..b0601e337 100755 --- a/scripts/generate_vk_helpers.py +++ b/scripts/generate_vk_helpers.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2019-2022, Collabora, Ltd. +# Copyright 2019-2023, Collabora, Ltd. # SPDX-License-Identifier: BSL-1.0 """Simple script to update vk_helpers.{c,h}.""" @@ -170,6 +170,12 @@ def get_device_cmds(): Cmd("vkRegisterDisplayEventEXT", requires=("VK_EXT_display_control",)), None, Cmd("vkGetImageDrmFormatModifierPropertiesEXT", requires=("VK_EXT_image_drm_format_modifier",)), + None, + Cmd("vkCmdDebugMarkerBeginEXT", requires=("VK_EXT_debug_marker",)), + Cmd("vkCmdDebugMarkerEndEXT", requires=("VK_EXT_debug_marker",)), + Cmd("vkCmdDebugMarkerInsertEXT", requires=("VK_EXT_debug_marker",)), + Cmd("vkDebugMarkerSetObjectNameEXT", requires=("VK_EXT_debug_marker",)), + Cmd("vkDebugMarkerSetObjectTagEXT", requires=("VK_EXT_debug_marker",)), ] @@ -269,6 +275,7 @@ DEVICE_EXTENSIONS_TO_CHECK = [ "VK_KHR_maintenance4", "VK_KHR_timeline_semaphore", "VK_EXT_calibrated_timestamps", + "VK_EXT_debug_marker", "VK_EXT_display_control", "VK_EXT_external_memory_dma_buf", "VK_EXT_global_priority", diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c index dbf3640b8..99b100ffc 100644 --- a/src/xrt/auxiliary/vk/vk_bundle_init.c +++ b/src/xrt/auxiliary/vk/vk_bundle_init.c @@ -657,6 +657,7 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li vk->has_KHR_maintenance4 = false; vk->has_KHR_timeline_semaphore = false; vk->has_EXT_calibrated_timestamps = false; + vk->has_EXT_debug_marker = false; vk->has_EXT_display_control = false; vk->has_EXT_external_memory_dma_buf = false; vk->has_EXT_global_priority = false; @@ -747,6 +748,13 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li } #endif // defined(VK_EXT_calibrated_timestamps) +#if defined(VK_EXT_debug_marker) + if (strcmp(ext, VK_EXT_DEBUG_MARKER_EXTENSION_NAME) == 0) { + vk->has_EXT_debug_marker = true; + continue; + } +#endif // defined(VK_EXT_debug_marker) + #if defined(VK_EXT_display_control) if (strcmp(ext, VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME) == 0) { vk->has_EXT_display_control = true; diff --git a/src/xrt/auxiliary/vk/vk_function_loaders.c b/src/xrt/auxiliary/vk/vk_function_loaders.c index 54d626d9a..6f7f33442 100644 --- a/src/xrt/auxiliary/vk/vk_function_loaders.c +++ b/src/xrt/auxiliary/vk/vk_function_loaders.c @@ -1,4 +1,4 @@ -// Copyright 2019-2022, Collabora, Ltd. +// Copyright 2019-2023, Collabora, Ltd. // SPDX-License-Identifier: BSL-1.0 /*! * @file @@ -307,8 +307,17 @@ vk_get_device_functions(struct vk_bundle *vk) #if defined(VK_EXT_image_drm_format_modifier) vk->vkGetImageDrmFormatModifierPropertiesEXT = GET_DEV_PROC(vk, vkGetImageDrmFormatModifierPropertiesEXT); + #endif // defined(VK_EXT_image_drm_format_modifier) +#if defined(VK_EXT_debug_marker) + vk->vkCmdDebugMarkerBeginEXT = GET_DEV_PROC(vk, vkCmdDebugMarkerBeginEXT); + vk->vkCmdDebugMarkerEndEXT = GET_DEV_PROC(vk, vkCmdDebugMarkerEndEXT); + vk->vkCmdDebugMarkerInsertEXT = GET_DEV_PROC(vk, vkCmdDebugMarkerInsertEXT); + vk->vkDebugMarkerSetObjectNameEXT = GET_DEV_PROC(vk, vkDebugMarkerSetObjectNameEXT); + vk->vkDebugMarkerSetObjectTagEXT = GET_DEV_PROC(vk, vkDebugMarkerSetObjectTagEXT); +#endif // defined(VK_EXT_debug_marker) + // end of GENERATED device loader code - do not modify - used by scripts // clang-format on return VK_SUCCESS; diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index db2991669..d402f6b6c 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -1,4 +1,4 @@ -// Copyright 2019-2022, Collabora, Ltd. +// Copyright 2019-2023, Collabora, Ltd. // SPDX-License-Identifier: BSL-1.0 /*! * @file @@ -130,6 +130,7 @@ struct vk_bundle bool has_KHR_maintenance4; bool has_KHR_timeline_semaphore; bool has_EXT_calibrated_timestamps; + bool has_EXT_debug_marker; bool has_EXT_display_control; bool has_EXT_external_memory_dma_buf; bool has_EXT_global_priority; @@ -413,8 +414,17 @@ struct vk_bundle #if defined(VK_EXT_image_drm_format_modifier) PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT; + #endif // defined(VK_EXT_image_drm_format_modifier) +#if defined(VK_EXT_debug_marker) + PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT; + PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT; + PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT; + PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT; + PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT; +#endif // defined(VK_EXT_debug_marker) + // end of GENERATED device loader code - do not modify - used by scripts };