Repository navigation
Fix driver allocations - #43
Merged
jimblacklercorp merged 2 commits intoOct 14, 2026
Merged
jimblacklercorp merged 2 commits into
jimblacklercorp merged 2 commits into
Conversation
Per the VK_EXT_device_memory_report specification, VkDeviceMemoryReportFlagsEXT
is reserved for future use and is always 0. Explicit application allocations
report VK_OBJECT_TYPE_DEVICE_MEMORY, while driver-internal allocations report
other objectTypes (or VK_OBJECT_TYPE_UNKNOWN).
- Remove the non-existent VK_DEVICE_MEMORY_REPORT_FLAG_INTERNAL_OBJECT_BIT_EXT
macro from device_memory_report.h.
- Classify allocations in OnMemoryReportEvent via
objectType != VK_OBJECT_TYPE_DEVICE_MEMORY.
- Partition memory_allocations_ by AllocationKey ({is_driver, id}) so driver
memoryObjectIds and application VkDeviceMemory handles cannot collide.
- Clean up existing active tracking (counters, trace events, and debug names)
if a duplicate ALLOCATE/IMPORT arrives for the same key without an
intervening FREE/UNIMPORT.
- Emit paired DESTROY + CREATE instant trace events via
ReattributeDriverAllocations in OnCreateImage and OnCreateBuffer when a
driver allocation created before the post-call hook is re-attributed to its
resource usage cluster.
- Verify resource type matches allocation object_type when resolving driver
allocation clusters in UpdateAllocationUnboundCounter.
- Update and expand unit tests in test_devicememoryreport.cpp.
Bug: 572710102
…llocations Default driver-internal allocations that are not associated with a tracked VkImage or VkBuffer to the 'driver' cluster (emitting counter 'vulkan.mem.driver.usage.driver' and allocation memory_type 'driver') rather than 'unbound_memory', so they are distinguished from application unbound VkDeviceMemory in trace counters and memory snapshots. Bug: 572710102
olehkuznetsov
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per the VK_EXT_device_memory_report specification, VkDeviceMemoryReportFlagsEXT
is reserved for future use and is always 0. Explicit application allocations
report VK_OBJECT_TYPE_DEVICE_MEMORY, while driver-internal allocations report
other objectTypes (or VK_OBJECT_TYPE_UNKNOWN).
macro from device_memory_report.h.
objectType != VK_OBJECT_TYPE_DEVICE_MEMORY.
memoryObjectIds and application VkDeviceMemory handles cannot collide.
if a duplicate ALLOCATE/IMPORT arrives for the same key without an
intervening FREE/UNIMPORT.
ReattributeDriverAllocations in OnCreateImage and OnCreateBuffer when a
driver allocation created before the post-call hook is re-attributed to its
resource usage cluster.
allocation clusters in UpdateAllocationUnboundCounter.
Bug: 572710102