mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-23 22:58:33 +02:00
vulkan: implement VK_EXT_debug_marker
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32722>
This commit is contained in:
parent
d55418dae7
commit
020a6bc282
15 changed files with 95 additions and 3 deletions
|
|
@ -615,7 +615,7 @@ Khronos extensions that are not part of any Vulkan version:
|
|||
VK_EXT_conservative_rasterization DONE (anv, nvk, panvk/v11+, radv, vn, tu/a7xx+)
|
||||
VK_EXT_custom_border_color DONE (anv, hasvk, hk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_EXT_custom_resolve DONE (radv, tu)
|
||||
VK_EXT_debug_marker DONE (radv)
|
||||
VK_EXT_debug_marker DONE (anv, dzn, hasvk, hk, kk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_EXT_debug_report DONE (anv, dzn, hasvk, hk, kk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_EXT_debug_utils DONE (anv, dzn, hasvk, hk, kk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
|
||||
VK_EXT_depth_bias_control DONE (anv, hk, lvp, nvk, panvk, radv, vn)
|
||||
|
|
|
|||
|
|
@ -20,3 +20,4 @@ VK_KHR_shader_fma on nvk
|
|||
Support for G1-Ultra, G1-Premium and G1-Pro GPUs on Panfrost and PanVK
|
||||
VK_EXT_shader_atomic_float on nvk
|
||||
VK_{KHR,EXT}_index_type_uint8 on pvr
|
||||
VK_EXT_debug_marker in vulkan runtime
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ hk_get_device_extensions(const struct hk_instance *instance,
|
|||
.EXT_conditional_rendering = false,
|
||||
.EXT_color_write_enable = true,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_bias_control = true,
|
||||
.EXT_depth_clip_control = false,
|
||||
.EXT_depth_clip_enable = true,
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ get_device_extensions(const struct v3dv_physical_device *device,
|
|||
.EXT_border_color_swizzle = true,
|
||||
.EXT_color_write_enable = true,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_clamp_zero_one = device->devinfo.ver >= 71,
|
||||
.EXT_depth_clip_control = true,
|
||||
.EXT_depth_clip_enable = device->devinfo.ver >= 71,
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ get_device_extensions(const struct tu_physical_device *device,
|
|||
.EXT_conservative_rasterization = device->info->chip >= 7,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_custom_resolve = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_clamp_control = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
.EXT_depth_clip_control = true,
|
||||
|
|
|
|||
|
|
@ -233,6 +233,7 @@ static const struct vk_device_extension_table lvp_device_extensions_supported =
|
|||
.EXT_calibrated_timestamps = true,
|
||||
.EXT_color_write_enable = true,
|
||||
.EXT_conditional_rendering = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_bias_control = true,
|
||||
.EXT_depth_clip_enable = true,
|
||||
.EXT_depth_clip_control = true,
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ static void pvr_physical_device_get_supported_extensions(
|
|||
.EXT_border_color_swizzle = true,
|
||||
.EXT_color_write_enable = true,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
.EXT_depth_clip_enable = true,
|
||||
.EXT_image_drm_format_modifier = true,
|
||||
|
|
|
|||
|
|
@ -288,6 +288,7 @@ get_device_extensions(const struct anv_physical_device *device,
|
|||
*/
|
||||
.EXT_conservative_rasterization = device->info.platform != INTEL_PLATFORM_SKL,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_bias_control = true,
|
||||
.EXT_depth_clamp_control = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
|
|
|
|||
|
|
@ -280,6 +280,7 @@ get_device_extensions(const struct anv_physical_device *device,
|
|||
.EXT_color_write_enable = true,
|
||||
.EXT_conditional_rendering = device->info.verx10 >= 75,
|
||||
.EXT_custom_border_color = device->info.ver >= 8,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
.EXT_depth_clamp_control = true,
|
||||
.EXT_depth_clip_control = true,
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ kk_get_device_extensions(const struct kk_instance *instance,
|
|||
.EXT_attachment_feedback_loop_dynamic_state = true,
|
||||
.EXT_calibrated_timestamps = true,
|
||||
.EXT_conditional_rendering = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_clip_control = true,
|
||||
.EXT_extended_dynamic_state3 = true,
|
||||
.EXT_external_memory_metal = true,
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ dzn_physical_device_get_extensions(struct dzn_physical_device *pdev)
|
|||
.KHR_timeline_semaphore = true,
|
||||
.KHR_uniform_buffer_standard_layout = true,
|
||||
.EXT_buffer_device_address = pdev->shader_model >= D3D_SHADER_MODEL_6_6,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_descriptor_indexing = pdev->shader_model >= D3D_SHADER_MODEL_6_6,
|
||||
#if defined(_WIN32)
|
||||
.EXT_external_memory_host = pdev->dev13,
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ nvk_get_device_extensions(const struct nvk_instance *instance,
|
|||
.EXT_conservative_rasterization = info->cls_eng3d >= MAXWELL_B,
|
||||
.EXT_color_write_enable = true,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_bias_control = true,
|
||||
.EXT_depth_clamp_control = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ panvk_per_arch(get_physical_device_extensions)(
|
|||
.EXT_color_write_enable = true,
|
||||
.EXT_conservative_rasterization = PAN_ARCH >= 11,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_bias_control = true,
|
||||
.EXT_depth_clamp_control = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
|
|
|
|||
|
|
@ -1406,6 +1406,7 @@ vn_physical_device_get_passthrough_extensions(
|
|||
.EXT_conditional_rendering = true,
|
||||
.EXT_conservative_rasterization = true,
|
||||
.EXT_custom_border_color = true,
|
||||
.EXT_debug_marker = true,
|
||||
.EXT_depth_bias_control = true,
|
||||
.EXT_depth_clamp_control = true,
|
||||
.EXT_depth_clamp_zero_one = true,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "stdarg.h"
|
||||
#include "util/u_dynarray.h"
|
||||
#include "util/u_printf.h"
|
||||
#include "vulkan/vulkan_core.h"
|
||||
|
||||
void
|
||||
vk_debug_message(struct vk_instance *instance,
|
||||
|
|
@ -261,8 +262,6 @@ vk_common_DebugMarkerSetObjectNameEXT(
|
|||
{
|
||||
VK_FROM_HANDLE(vk_device, device, _device);
|
||||
|
||||
assert(pNameInfo->sType == VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT);
|
||||
|
||||
VkObjectType object_type;
|
||||
switch (pNameInfo->objectType) {
|
||||
case VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT:
|
||||
|
|
@ -298,6 +297,50 @@ vk_common_DebugMarkerSetObjectNameEXT(
|
|||
return device->dispatch_table.SetDebugUtilsObjectNameEXT(_device, &name_info);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
vk_common_DebugMarkerSetObjectTagEXT(
|
||||
VkDevice _device,
|
||||
const VkDebugMarkerObjectTagInfoEXT *pTagInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_device, device, _device);
|
||||
|
||||
VkObjectType object_type;
|
||||
switch (pTagInfo->objectType) {
|
||||
case VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT:
|
||||
object_type = VK_OBJECT_TYPE_SURFACE_KHR;
|
||||
break;
|
||||
case VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT:
|
||||
object_type = VK_OBJECT_TYPE_SWAPCHAIN_KHR;
|
||||
break;
|
||||
case VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT:
|
||||
object_type = VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT;
|
||||
break;
|
||||
case VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT:
|
||||
object_type = VK_OBJECT_TYPE_DISPLAY_KHR;
|
||||
break;
|
||||
case VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT:
|
||||
object_type = VK_OBJECT_TYPE_DISPLAY_MODE_KHR;
|
||||
break;
|
||||
case VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT:
|
||||
object_type = VK_OBJECT_TYPE_VALIDATION_CACHE_EXT;
|
||||
break;
|
||||
default:
|
||||
object_type = (VkObjectType)pTagInfo->objectType;
|
||||
break;
|
||||
}
|
||||
|
||||
VkDebugUtilsObjectTagInfoEXT tag_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
|
||||
.objectType = object_type,
|
||||
.objectHandle = pTagInfo->object,
|
||||
.tagName = pTagInfo->tagName,
|
||||
.tagSize = pTagInfo->tagSize,
|
||||
.pTag = pTagInfo->pTag
|
||||
};
|
||||
|
||||
return device->dispatch_table.SetDebugUtilsObjectTagEXT(_device, &tag_info);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
vk_common_SetDebugUtilsObjectNameEXT(
|
||||
VkDevice _device,
|
||||
|
|
@ -433,6 +476,42 @@ vk_common_CmdInsertDebugUtilsLabelEXT(
|
|||
command_buffer->region_begin = false;
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
vk_common_CmdDebugMarkerBeginEXT(
|
||||
VkCommandBuffer _commandBuffer,
|
||||
const VkDebugMarkerMarkerInfoEXT *pMarkerInfo)
|
||||
{
|
||||
VkDebugUtilsLabelEXT label_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
|
||||
.pNext = pMarkerInfo->pNext,
|
||||
.pLabelName = pMarkerInfo->pMarkerName,
|
||||
};
|
||||
memcpy(label_info.color, pMarkerInfo->color, sizeof(label_info.color));
|
||||
|
||||
vk_common_CmdBeginDebugUtilsLabelEXT(_commandBuffer, &label_info);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
vk_common_CmdDebugMarkerEndEXT(VkCommandBuffer _commandBuffer)
|
||||
{
|
||||
vk_common_CmdEndDebugUtilsLabelEXT(_commandBuffer);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
vk_common_CmdDebugMarkerInsertEXT(
|
||||
VkCommandBuffer _commandBuffer,
|
||||
const VkDebugMarkerMarkerInfoEXT *pMarkerInfo)
|
||||
{
|
||||
VkDebugUtilsLabelEXT label_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
|
||||
.pNext = pMarkerInfo->pNext,
|
||||
.pLabelName = pMarkerInfo->pMarkerName,
|
||||
};
|
||||
memcpy(label_info.color, pMarkerInfo->color, sizeof(label_info.color));
|
||||
|
||||
vk_common_CmdInsertDebugUtilsLabelEXT(_commandBuffer, &label_info);
|
||||
}
|
||||
|
||||
void
|
||||
vk_queue_begin_debug_utils_label(struct vk_queue *queue,
|
||||
const VkDebugUtilsLabelEXT *pLabelInfo)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue