debuggingvulkanlabeling

Is it possible to annotate a VkDeviceMemory object with a name, for debugging purposes?


I use Vulkan 1.3 with a validation layer.

This layer can throw up errors which are hard to read.

I would like to know if I can tag objects with a human readable name so that I know which buffer is misbehaving.

For instance, I get this validation error:

VUID-VkMappedMemoryRange-size-01390(ERROR / SPEC): msgNum: -582062709 - Validation Error: [ VUID-VkMappedMemoryRange-size-01390 ] Object 0: handle = 0x160000000016, type = VK_OBJECT_TYPE_DEVICE_MEMORY; | MessageID = 0xdd4e6d8b | vkFlushMappedMemoryRanges: Size in pMemRanges[0] is 0x20, which is not a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x40) and offset + size (0x0 + 0x20 = 0x20) not equal to the memory size (0x3000). The Vulkan spec states: If size is not equal to VK_WHOLE_SIZE, size must either be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize, or offset plus size must equal the size of memory (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkMappedMemoryRange-size-01390)

I use many buffers and many memory objects in my application, and I do not know what 0x160000000016 refers to.

In OpenGL there is a mechanism to tag buffers called glObjectPtrLabel()

What is the Vulkan equivalent of OpenGL object naming?


Solution

  • The Vk_EXT_debug_utils extension offers this capability (through the function vkSetDebugUtilsObjectNameEXT). There are older extensions that can work, but this is the most recent. It is provided by the Vulkan SDK (the same layers that gave you that error), not by the driver itself.