4
votes

Whenever an object in Vulkan is destroyed, and the VK_LAYER_LUNARG_object_tracker layer is enabled, and a debug report is installed, it will report the destroy call and give the total number of objects remaining via the callback. Eg:

INFO: [OBJTRACK]: OBJ_STAT Destroy VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT obj 0xcf43130 (217 total objs remain & 1 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT objs).

Is there some way to get information about the objects that are still allocated?

Edit: Inspecting the source of the object_tracker layer (https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/layers/object_tracker.h), it seems that there is a prototype for objTrackGetObjectsOfTypeCount, but they don't seem like they have implementations anywhere. Is this function somehow accessible?

1
I guess you could create your own layer or simply keep track of them in your own application.tambre
Sure, but, I would like to know if there is such functionality built-in (eg. something similar to DXGI::ReportLiveObjects - msdn.microsoft.com/en-us/library/windows/desktop/hh780352.aspx) . Obviously, the object_tracker knows how many of each type there are already - I would like to know if there's somewhat to extract that.MuertoExcobito
I guess you can implement your own VkAllocatorCallback (as a Singleton), and put some counters over there (perhaps mapping object name to counter). I wrote a naive implementation of VkAllocationCallback using malloc()/free() here, with testing code Here.Alex Byrth

1 Answers

4
votes

Vulkan is built with minimal driver overhead, so driver does as little as possible and there is no such built-in functionality. Only way to get info about existing objects is to either keep track of the objects yourself or write a layer to do it for you.

There don't seem to be any existing layers, which such functionality. For writing a validation layer, you might want to take a look at the existing Vulkan validation layers.