Class EXTDebugMarker
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.
Examples
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 visualization 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);
- Name String
VK_EXT_debug_marker- Extension Type
- Device extension
- Registered Extension Number
- 23
- Revision
- 4
- Extension and Version Dependencies
VK_EXT_debug_report- Deprecation State
- Promoted to
VK_EXT_debug_utilsextension
- Promoted to
- Special Use
- Contact
- Baldur Karlsson baldurk
Other Extension Metadata
- Last Modified Date
- 2017-01-31
- IP Status
- No known IP claims.
- Contributors
- Baldur Karlsson
- Dan Ginsburg, Valve
- Jon Ashburn, LunarG
- Kyle Spagnoli, NVIDIA
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsVkStructureType.static final intExtendsVkStructureType.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidnvkCmdDebugMarkerBeginEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of:CmdDebugMarkerBeginEXTstatic voidnvkCmdDebugMarkerInsertEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of:CmdDebugMarkerInsertEXTstatic intnvkDebugMarkerSetObjectNameEXT(org.lwjgl.vulkan.VkDevice device, long pNameInfo) Unsafe version of:DebugMarkerSetObjectNameEXTstatic intnvkDebugMarkerSetObjectTagEXT(org.lwjgl.vulkan.VkDevice device, long pTagInfo) Unsafe version of:DebugMarkerSetObjectTagEXTstatic voidvkCmdDebugMarkerBeginEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT pMarkerInfo) Open a command buffer marker region.static voidvkCmdDebugMarkerEndEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer) Close a command buffer marker region.static voidvkCmdDebugMarkerInsertEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT pMarkerInfo) Insert a marker label into a command buffer.static intvkDebugMarkerSetObjectNameEXT(org.lwjgl.vulkan.VkDevice device, VkDebugMarkerObjectNameInfoEXT pNameInfo) Give an application-defined name to an object.static intvkDebugMarkerSetObjectTagEXT(org.lwjgl.vulkan.VkDevice device, VkDebugMarkerObjectTagInfoEXT pTagInfo) Attach arbitrary data to an object.
-
Field Details
-
VK_EXT_DEBUG_MARKER_SPEC_VERSION
public static final int VK_EXT_DEBUG_MARKER_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_EXT_DEBUG_MARKER_EXTENSION_NAME
The extension name.- See Also:
-
VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT
public static final int VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT
public static final int VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXTExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT
public static final int VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXTExtendsVkStructureType.Enum values:
- See Also:
-
-
Method Details
-
nvkDebugMarkerSetObjectTagEXT
public static int nvkDebugMarkerSetObjectTagEXT(org.lwjgl.vulkan.VkDevice device, long pTagInfo) Unsafe version of:DebugMarkerSetObjectTagEXT -
vkDebugMarkerSetObjectTagEXT
public static int vkDebugMarkerSetObjectTagEXT(org.lwjgl.vulkan.VkDevice device, VkDebugMarkerObjectTagInfoEXT pTagInfo) Attach arbitrary data to an object.C Specification
In 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
VkShaderModulecould have additional debugging data attached to it to aid in offline shader tracing. To attach data to an object, call:VkResult vkDebugMarkerSetObjectTagEXT( VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo);Valid Usage (Implicit)
devicemust be a validVkDevicehandlepTagInfomust be a valid pointer to a validVkDebugMarkerObjectTagInfoEXTstructure
Host Synchronization
- Host access to
pTagInfo→objectmust be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the device that created the object.pTagInfo- a pointer to aVkDebugMarkerObjectTagInfoEXTstructure specifying the parameters of the tag to attach to the object.
-
nvkDebugMarkerSetObjectNameEXT
public static int nvkDebugMarkerSetObjectNameEXT(org.lwjgl.vulkan.VkDevice device, long pNameInfo) Unsafe version of:DebugMarkerSetObjectNameEXT -
vkDebugMarkerSetObjectNameEXT
public static int vkDebugMarkerSetObjectNameEXT(org.lwjgl.vulkan.VkDevice device, VkDebugMarkerObjectNameInfoEXT pNameInfo) Give an application-defined name to an object.C Specification
An object can be given an application-defined name by calling:
VkResult vkDebugMarkerSetObjectNameEXT( VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo);Valid Usage (Implicit)
devicemust be a validVkDevicehandlepNameInfomust be a valid pointer to a validVkDebugMarkerObjectNameInfoEXTstructure
Host Synchronization
- Host access to
pNameInfo→objectmust be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the device that created the object.pNameInfo- a pointer to aVkDebugMarkerObjectNameInfoEXTstructure specifying the parameters of the name to set on the object.
-
nvkCmdDebugMarkerBeginEXT
public static void nvkCmdDebugMarkerBeginEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of:CmdDebugMarkerBeginEXT -
vkCmdDebugMarkerBeginEXT
public static void vkCmdDebugMarkerBeginEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT pMarkerInfo) Open a command buffer marker region.C Specification
A marker region can be opened by calling:
void vkCmdDebugMarkerBeginEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo);Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlepMarkerInfomust be a valid pointer to a validVkDebugMarkerMarkerInfoEXTstructurecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations - This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Video Coding Scope Supported Queue Types Command Type Primary Secondary Both Outside Graphics Compute Action See Also
- Parameters:
commandBuffer- the command buffer into which the command is recorded.pMarkerInfo- a pointer to aVkDebugMarkerMarkerInfoEXTstructure specifying the parameters of the marker region to open.
-
vkCmdDebugMarkerEndEXT
public static void vkCmdDebugMarkerEndEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer) Close a command buffer marker region.C Specification
A marker region can be closed by calling:
void vkCmdDebugMarkerEndEXT( VkCommandBuffer commandBuffer);Description
An 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
vkCmdDebugMarkerBeginEXTandvkCmdDebugMarkerEndEXTmust be matched and balanced.Valid Usage
- There must be an outstanding
CmdDebugMarkerBeginEXTcommand prior to thevkCmdDebugMarkerEndEXTon the queue thatcommandBufferis submitted to - If
commandBufferis a secondary command buffer, there must be an outstandingCmdDebugMarkerBeginEXTcommand recorded tocommandBufferthat has not previously been ended by a call toCmdDebugMarkerEndEXT
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations - This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Video Coding Scope Supported Queue Types Command Type Primary Secondary Both Outside Graphics Compute Action - Parameters:
commandBuffer- the command buffer into which the command is recorded.
- There must be an outstanding
-
nvkCmdDebugMarkerInsertEXT
public static void nvkCmdDebugMarkerInsertEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of:CmdDebugMarkerInsertEXT -
vkCmdDebugMarkerInsertEXT
public static void vkCmdDebugMarkerInsertEXT(org.lwjgl.vulkan.VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT pMarkerInfo) Insert a marker label into a command buffer.C Specification
A single marker label can be inserted into a command buffer by calling:
void vkCmdDebugMarkerInsertEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo);Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandlepMarkerInfomust be a valid pointer to a validVkDebugMarkerMarkerInfoEXTstructurecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations - This command must only be called outside of a video coding scope
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Video Coding Scope Supported Queue Types Command Type Primary Secondary Both Outside Graphics Compute Action See Also
- Parameters:
commandBuffer- the command buffer into which the command is recorded.pMarkerInfo- a pointer to aVkDebugMarkerMarkerInfoEXTstructure specifying the parameters of the marker to insert.
-