VK_EXT_debug_marker extension is a device extension. It introduces concepts of object naming and tagging, for better tracking of Vulkan objects, as well as additional commands for recording annotations of named sections of a workload to aid organization and offline analysis in external tools.
Example 1
Associate a name with an image, for easier debugging in external tools or with validation layers that can print a friendly name when referring to objects in error messages.
extern VkDevice device;
extern VkImage image;
// Must call extension functions through a function pointer:
PFN_vkDebugMarkerSetObjectNameEXT pfnDebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT)vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectNameEXT");
// Set a name on the image
const VkDebugMarkerObjectNameInfoEXT imageNameInfo =
{
.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT,
.pNext = NULL,
.objectType = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
.object = (uint64_t)image,
.pObjectName = "Brick Diffuse Texture",
};
pfnDebugMarkerSetObjectNameEXT(device, &imageNameInfo);
// A subsequent error might print:
// Image 'Brick Diffuse Texture' (0xc0dec0dedeadbeef) is used in a
// command buffer with no memory bound to it.
Example 2
Annotating regions of a workload with naming information so that offline analysis tools can display a more usable visualisation of the commands submitted.
extern VkDevice device;
extern VkCommandBuffer commandBuffer;
// Must call extension functions through a function pointer:
PFN_vkCmdDebugMarkerBeginEXT pfnCmdDebugMarkerBeginEXT = (PFN_vkCmdDebugMarkerBeginEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerBeginEXT");
PFN_vkCmdDebugMarkerEndEXT pfnCmdDebugMarkerEndEXT = (PFN_vkCmdDebugMarkerEndEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerEndEXT");
PFN_vkCmdDebugMarkerInsertEXT pfnCmdDebugMarkerInsertEXT = (PFN_vkCmdDebugMarkerInsertEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerInsertEXT");
// Describe the area being rendered
const VkDebugMarkerMarkerInfoEXT houseMarker =
{
.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT,
.pNext = NULL,
.pMarkerName = "Brick House",
.color = { 1.0f, 0.0f, 0.0f, 1.0f },
};
// Start an annotated group of calls under the 'Brick House' name
pfnCmdDebugMarkerBeginEXT(commandBuffer, &houseMarker);
{
// A mutable structure for each part being rendered
VkDebugMarkerMarkerInfoEXT housePartMarker =
{
.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT,
.pNext = NULL,
.pMarkerName = NULL,
.color = { 0.0f, 0.0f, 0.0f, 0.0f },
};
// Set the name and insert the marker
housePartMarker.pMarkerName = "Walls";
pfnCmdDebugMarkerInsertEXT(commandBuffer, &housePartMarker);
// Insert the drawcall for the walls
vkCmdDrawIndexed(commandBuffer, 1000, 1, 0, 0, 0);
// Insert a recursive region for two sets of windows
housePartMarker.pMarkerName = "Windows";
pfnCmdDebugMarkerBeginEXT(commandBuffer, &housePartMarker);
{
vkCmdDrawIndexed(commandBuffer, 75, 6, 1000, 0, 0);
vkCmdDrawIndexed(commandBuffer, 100, 2, 1450, 0, 0);
}
pfnCmdDebugMarkerEndEXT(commandBuffer);
housePartMarker.pMarkerName = "Front Door";
pfnCmdDebugMarkerInsertEXT(commandBuffer, &housePartMarker);
vkCmdDrawIndexed(commandBuffer, 350, 1, 1650, 0, 0);
housePartMarker.pMarkerName = "Roof";
pfnCmdDebugMarkerInsertEXT(commandBuffer, &housePartMarker);
vkCmdDrawIndexed(commandBuffer, 500, 1, 2000, 0, 0);
}
// End the house annotation started above
pfnCmdDebugMarkerEndEXT(commandBuffer);
VK_EXT_debug_markerVK_EXT_debug_reportVK_EXT_debug_utils extension| Modifier and Type | Field and Description |
|---|---|
| public static final String | VK_EXT_DEBUG_MARKER_EXTENSION_NAME
The extension name. |
| public static final int | VK_EXT_DEBUG_MARKER_SPEC_VERSION
The extension specification version. |
| public static final int | VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT
Extends |
| public static final int | VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT
Extends |
| public static final int | VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT
Extends |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void | nvkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of: |
| public static void | nvkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of: |
| public static int | nvkDebugMarkerSetObjectNameEXT(VkDevice device, long pNameInfo)
Unsafe version of: |
| public static int | nvkDebugMarkerSetObjectTagEXT(VkDevice device, long pTagInfo)
Unsafe version of: |
| public static void | vkCmdDebugMarkerBeginEXT(VkCommandBuffer
the command buffer into which the command is recorded. commandBuffer, VkDebugMarkerMarkerInfoEXT a pointer to a pMarkerInfo)VkDebugMarkerMarkerInfoEXT structure specifying the parameters of the marker region to open.Open a command buffer marker region. |
| public static void | vkCmdDebugMarkerEndEXT(VkCommandBuffer
the command buffer into which the command is recorded. commandBuffer)Close a command buffer marker region. |
| public static void | vkCmdDebugMarkerInsertEXT(VkCommandBuffer
the command buffer into which the command is recorded. commandBuffer, VkDebugMarkerMarkerInfoEXT a pointer to a pMarkerInfo)VkDebugMarkerMarkerInfoEXT structure specifying the parameters of the marker to insert.Insert a marker label into a command buffer. |
| public static int | vkDebugMarkerSetObjectNameEXT(VkDevice
the device that created the object. device, VkDebugMarkerObjectNameInfoEXT a pointer to a pNameInfo)VkDebugMarkerObjectNameInfoEXT structure specifying the parameters of the name to set on the object.Give a user-friendly name to an object. |
| public static int | vkDebugMarkerSetObjectTagEXT(VkDevice
the device that created the object. device, VkDebugMarkerObjectTagInfoEXT a pointer to a pTagInfo)VkDebugMarkerObjectTagInfoEXT structure specifying the parameters of the tag to attach to the object.Attach arbitrary data to an object. |
| VK_EXT_DEBUG_MARKER_EXTENSION_NAME | back to summary |
|---|---|
| public static final String VK_EXT_DEBUG_MARKER_EXTENSION_NAME The extension name. | |
| VK_EXT_DEBUG_MARKER_SPEC_VERSION | back to summary |
|---|---|
| public static final int VK_EXT_DEBUG_MARKER_SPEC_VERSION The extension specification version. | |
| VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT Extends Enum values: | |
| VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT Extends Enum values: | |
| VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT Extends Enum values: | |
| EXTDebugMarker | back to summary |
|---|---|
| protected EXTDebugMarker() | |
| nvkCmdDebugMarkerBeginEXT | back to summary |
|---|---|
| public static void nvkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of: | |
| nvkCmdDebugMarkerInsertEXT | back to summary |
|---|---|
| public static void nvkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of: | |
| nvkDebugMarkerSetObjectNameEXT | back to summary |
|---|---|
| public static int nvkDebugMarkerSetObjectNameEXT(VkDevice device, long pNameInfo) Unsafe version of: | |
| nvkDebugMarkerSetObjectTagEXT | back to summary |
|---|---|
| public static int nvkDebugMarkerSetObjectTagEXT(VkDevice device, long pTagInfo) Unsafe version of: | |
| vkCmdDebugMarkerBeginEXT | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void vkCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT pMarkerInfo) Open a command buffer marker region. C SpecificationA marker region can be opened by calling:
Valid Usage (Implicit)
Host Synchronization
Command Properties
See Also
| |||||||||||
| vkCmdDebugMarkerEndEXT | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) Close a command buffer marker region. C SpecificationA marker region can be closed by calling:
DescriptionAn application may open a marker region in one command buffer and close it in another, or otherwise split marker regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to Valid Usage
Valid Usage (Implicit)
Host Synchronization
Command Properties
| |||||||||||
| vkCmdDebugMarkerInsertEXT | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT pMarkerInfo) Insert a marker label into a command buffer. C SpecificationA single marker label can be inserted into a command buffer by calling:
Valid Usage (Implicit)
Host Synchronization
Command Properties
See Also
| |||||||||||
| vkDebugMarkerSetObjectNameEXT | back to summary |
|---|---|
| public static int vkDebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT pNameInfo) Give a user-friendly name to an object. C SpecificationAn object can be given a user-friendly name by calling:
Valid Usage (Implicit)
Host Synchronization
Return Codes
See Also
| |
| vkDebugMarkerSetObjectTagEXT | back to summary |
|---|---|
| public static int vkDebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT pTagInfo) Attach arbitrary data to an object. C SpecificationIn addition to setting a name for an object, debugging and validation layers may have uses for additional binary data on a per-object basis that has no other place in the Vulkan API. For example, a
Valid Usage (Implicit)
Host Synchronization
Return Codes
See Also
| |