VulkanTools icon indicating copy to clipboard operation
VulkanTools copied to clipboard

apidump: feature request: Use handle formatting for uint64 values with objectType tags

Open kocdemir opened this issue 1 year ago • 0 comments

API dump is printing some uint64_t values, which are tagged with objecttype="objectType" in vk.xml, using the integer form. It would be much better to print them similar to the object handles to be able to easily match the usages within an API dump listing.

Example, VkDebugUtilsObjectNameInfoEXT call defined as:

<type category="struct" name="VkDebugUtilsObjectNameInfoEXT" structextends="VkPipelineShaderStageCreateInfo">
    <member values="VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
    <member optional="true">const <type>void</type>*                                            <name>pNext</name></member>
    <member><type>VkObjectType</type>                                           <name>objectType</name></member>
    <member objecttype="objectType"><type>uint64_t</type>                                               <name>objectHandle</name></member>
    <member optional="true" len="null-terminated">const <type>char</type>*      <name>pObjectName</name></member>
</type>

Currently the dump generates output like:

vkCreateImageView(device, pCreateInfo, pAllocator, pView) returns VkResult VK_SUCCESS (0):
 device:                         VkDevice = 00000193F9169AA0 [AEMU_Device]
 pCreateInfo:                    const VkImageViewCreateInfo* = 0000004E451653E0:
  ...
 pView:                          VkImageView* = 00000193F95EC0D0

vkSetDebugUtilsObjectNameEXT(device, pNameInfo) returns VkResult VK_SUCCESS (0):
 device:                         VkDevice = 00000193F9169AA0 [AEMU_Device]
 pNameInfo:                      const VkDebugUtilsObjectNameInfoEXT* = 0000004E451650F0:
  sType:                          VkStructureType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT (1000128000)
  pNext:                          const void* = NULL
  objectType:                     VkObjectType = VK_OBJECT_TYPE_IMAGE_VIEW (14)
  objectHandle:                   uint64_t = 1735055556816    <---  Feature request: print this as 00000193F95EC0D0 instead
  pObjectName:                    const char* = "ColorBuffer:1"

And when the object is named, would be good to see the same formatting with the name of the object as well, similar to

vkDestroyImageView(device, imageView, pAllocator) returns void:
 device:                         VkDevice = 00000193F9169AA0 [AEMU_Device]
 imageView:                      VkImageView = 00000193F95EC0D0 [ColorBuffer:1]
 pAllocator:                     const VkAllocationCallbacks* = NULL

This would be quite useful especially for some extension functions like vkSetPrivateDataEXT.

kocdemir avatar Dec 02 '24 13:12 kocdemir