a/vk: Add VK_EXT_debug_utils

This commit is contained in:
Jakob Bornecrantz 2023-11-03 14:22:59 +00:00
parent 55725cb623
commit 91d4e399c8
5 changed files with 64 additions and 0 deletions

View file

@ -171,6 +171,15 @@ def get_device_cmds():
None,
Cmd("vkGetImageDrmFormatModifierPropertiesEXT", requires=("VK_EXT_image_drm_format_modifier",)),
None,
Cmd("vkCmdBeginDebugUtilsLabelEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkCmdEndDebugUtilsLabelEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkCmdInsertDebugUtilsLabelEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkQueueBeginDebugUtilsLabelEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkQueueEndDebugUtilsLabelEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkQueueInsertDebugUtilsLabelEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkSetDebugUtilsObjectNameEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkSetDebugUtilsObjectTagEXT", requires=("VK_EXT_debug_utils",)),
None,
Cmd("vkCmdDebugMarkerBeginEXT", requires=("VK_EXT_debug_marker",)),
Cmd("vkCmdDebugMarkerEndEXT", requires=("VK_EXT_debug_marker",)),
Cmd("vkCmdDebugMarkerInsertEXT", requires=("VK_EXT_debug_marker",)),
@ -254,6 +263,10 @@ def get_instance_cmds():
Cmd("vkCreateWin32SurfaceKHR", requires=("VK_USE_PLATFORM_WIN32_KHR",)),
None,
Cmd("vkGetPhysicalDeviceSurfaceCapabilities2EXT", requires=("VK_EXT_display_surface_counter",)),
None,
Cmd("vkCreateDebugUtilsMessengerEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkSubmitDebugUtilsMessageEXT", requires=("VK_EXT_debug_utils",)),
Cmd("vkDestroyDebugUtilsMessengerEXT", requires=("VK_EXT_debug_utils",)),
]
@ -261,6 +274,7 @@ def get_instance_cmds():
INSTANCE_EXTENSIONS_TO_CHECK = [
"VK_EXT_display_surface_counter",
"VK_EXT_swapchain_colorspace",
"VK_EXT_debug_utils",
]
# Sorted KHR, EXT, Vendor, interally alphabetically
DEVICE_EXTENSIONS_TO_CHECK = [

View file

@ -189,6 +189,7 @@ vk_fill_in_has_instance_extensions(struct vk_bundle *vk, struct u_string_list *e
// Reset before filling out.
vk->has_EXT_display_surface_counter = false;
vk->has_EXT_swapchain_colorspace = false;
vk->has_EXT_debug_utils = false;
const char *const *exts = u_string_list_get_data(ext_list);
uint32_t ext_count = u_string_list_get_size(ext_list);
@ -209,6 +210,13 @@ vk_fill_in_has_instance_extensions(struct vk_bundle *vk, struct u_string_list *e
continue;
}
#endif // defined(VK_EXT_swapchain_colorspace)
#if defined(VK_EXT_debug_utils)
if (strcmp(ext, VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) {
vk->has_EXT_debug_utils = true;
continue;
}
#endif // defined(VK_EXT_debug_utils)
}
// end of GENERATED instance extension code - do not modify - used by scripts
}

View file

@ -134,8 +134,15 @@ vk_get_instance_functions(struct vk_bundle *vk)
#if defined(VK_EXT_display_surface_counter)
vk->vkGetPhysicalDeviceSurfaceCapabilities2EXT = GET_INS_PROC(vk, vkGetPhysicalDeviceSurfaceCapabilities2EXT);
#endif // defined(VK_EXT_display_surface_counter)
#if defined(VK_EXT_debug_utils)
vk->vkCreateDebugUtilsMessengerEXT = GET_INS_PROC(vk, vkCreateDebugUtilsMessengerEXT);
vk->vkSubmitDebugUtilsMessageEXT = GET_INS_PROC(vk, vkSubmitDebugUtilsMessageEXT);
vk->vkDestroyDebugUtilsMessengerEXT = GET_INS_PROC(vk, vkDestroyDebugUtilsMessengerEXT);
#endif // defined(VK_EXT_debug_utils)
// end of GENERATED instance loader code - do not modify - used by scripts
// clang-format on
@ -310,6 +317,18 @@ vk_get_device_functions(struct vk_bundle *vk)
#endif // defined(VK_EXT_image_drm_format_modifier)
#if defined(VK_EXT_debug_utils)
vk->vkCmdBeginDebugUtilsLabelEXT = GET_DEV_PROC(vk, vkCmdBeginDebugUtilsLabelEXT);
vk->vkCmdEndDebugUtilsLabelEXT = GET_DEV_PROC(vk, vkCmdEndDebugUtilsLabelEXT);
vk->vkCmdInsertDebugUtilsLabelEXT = GET_DEV_PROC(vk, vkCmdInsertDebugUtilsLabelEXT);
vk->vkQueueBeginDebugUtilsLabelEXT = GET_DEV_PROC(vk, vkQueueBeginDebugUtilsLabelEXT);
vk->vkQueueEndDebugUtilsLabelEXT = GET_DEV_PROC(vk, vkQueueEndDebugUtilsLabelEXT);
vk->vkQueueInsertDebugUtilsLabelEXT = GET_DEV_PROC(vk, vkQueueInsertDebugUtilsLabelEXT);
vk->vkSetDebugUtilsObjectNameEXT = GET_DEV_PROC(vk, vkSetDebugUtilsObjectNameEXT);
vk->vkSetDebugUtilsObjectTagEXT = GET_DEV_PROC(vk, vkSetDebugUtilsObjectTagEXT);
#endif // defined(VK_EXT_debug_utils)
#if defined(VK_EXT_debug_marker)
vk->vkCmdDebugMarkerBeginEXT = GET_DEV_PROC(vk, vkCmdDebugMarkerBeginEXT);
vk->vkCmdDebugMarkerEndEXT = GET_DEV_PROC(vk, vkCmdDebugMarkerEndEXT);

View file

@ -116,6 +116,7 @@ struct vk_bundle
// beginning of GENERATED instance extension code - do not modify - used by scripts
bool has_EXT_display_surface_counter;
bool has_EXT_swapchain_colorspace;
bool has_EXT_debug_utils;
// end of GENERATED instance extension code - do not modify - used by scripts
// beginning of GENERATED device extension code - do not modify - used by scripts
@ -250,8 +251,15 @@ struct vk_bundle
#if defined(VK_EXT_display_surface_counter)
PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT;
#endif // defined(VK_EXT_display_surface_counter)
#if defined(VK_EXT_debug_utils)
PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT;
PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT;
PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT;
#endif // defined(VK_EXT_debug_utils)
// end of GENERATED instance loader code - do not modify - used by scripts
// beginning of GENERATED device loader code - do not modify - used by scripts
@ -417,6 +425,18 @@ struct vk_bundle
#endif // defined(VK_EXT_image_drm_format_modifier)
#if defined(VK_EXT_debug_utils)
PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT;
PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT;
PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT;
PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT;
PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT;
PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT;
PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT;
PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT;
#endif // defined(VK_EXT_debug_utils)
#if defined(VK_EXT_debug_marker)
PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT;
PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT;

View file

@ -468,6 +468,9 @@ static const char *optional_instance_extensions[] = {
#ifdef VK_EXT_display_surface_counter
VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME,
#endif
#if defined VK_EXT_debug_utils && !defined NDEBUG
VK_EXT_DEBUG_UTILS_EXTENSION_NAME,
#endif
};
// Note: Keep synchronized with comp_vk_glue - we should have everything they