Vulkan Memory Report layer: Vulkan Memory by Usage Type - #28
Vulkan Memory Report layer: Vulkan Memory by Usage Type#28jimblacklercorp wants to merge 2 commits into
Conversation
Implements VK_LAYER_GOOGLE_DeviceMemoryReport layer providing memory tracking by Usage Type. Exposes VK_EXT_device_memory_report and classifies allocations by Vulkan usage types (surface, texture, buffer, other). Emits Perfetto counters starting with vulkan.mem.app.usage.* and vulkan.mem.driver.usage.*.
| } | ||
|
|
||
| perfetto::CounterTrack GetCounterTrack(const char* name) { | ||
| return perfetto::CounterTrack(perfetto::DynamicString(name)); |
There was a problem hiding this comment.
We can specify a unit here. Bytes?
| if (strcmp(pName, "vkAllocateMemory") == 0) return reinterpret_cast<PFN_vkVoidFunction>(vkAllocateMemory); | ||
| if (strcmp(pName, "vkFreeMemory") == 0) return reinterpret_cast<PFN_vkVoidFunction>(vkFreeMemory); | ||
| if (strcmp(pName, "vkBindBufferMemory") == 0) return reinterpret_cast<PFN_vkVoidFunction>(vkBindBufferMemory); | ||
| if (strcmp(pName, "vkBindImageMemory") == 0) return reinterpret_cast<PFN_vkVoidFunction>(vkBindImageMemory); |
There was a problem hiding this comment.
We need to handle those as well:
vkBindBufferMemory2
vkBindImageMemory2
vkBindBufferMemory2KHR
vkBindImageMemory2KHR
olehkuznetsov
left a comment
There was a problem hiding this comment.
In Vulkan, applications often allocate a single large block of VkDeviceMemory and bind different sections (ranges) of it to multiple virtual resources (like buffers and images) using offsets. This is done to stay within the driver's maximum allocation count limit.
The current implementation of the memory report layer does not track partial memory bindings (sub-allocations). Instead, it attributes the entire size of the physical allocation to the category of the most recently bound resource.
Implements VK_LAYER_GOOGLE_DeviceMemoryReport layer providing memory tracking by Usage Type. Exposes VK_EXT_device_memory_report and classifies allocations by Vulkan usage types (surface, texture, buffer, other). Emits Perfetto counters starting with vulkan.mem.app.usage.* and vulkan.mem.driver.usage.*.