From 1e05cc8525c0e229a771ea7ed60adccf705fb965 Mon Sep 17 00:00:00 2001 From: Jim Blackler Date: Mon, 14 Sep 2026 08:05:06 +0000 Subject: [PATCH 1/6] device_memory_report: distinguish driver and application unbound memory Only inspect associated virtual resources for driver allocations when determining unbound track name, preventing handle collisions between VkDeviceMemory and previously registered VkBuffer/VkImage handles from misclassifying application unbound headroom. Also free the driver allocation at the end of EmitEventsAndSubCounters. DeviceMemoryReport is a process-wide singleton, so the previously leaked 2048 byte driver allocation stayed on vulkan.mem.driver.usage.unbound_memory and leaked into subsequent tests in the same binary, breaking the new attribution test. --- .../device_memory_report.cpp | 20 +++++-- .../device_memory_report.h | 7 +++ layersvt/test/test_devicememoryreport.cpp | 59 +++++++++++++++++++ 3 files changed, 80 insertions(+), 6 deletions(-) diff --git a/layersvt/device_memory_report/device_memory_report.cpp b/layersvt/device_memory_report/device_memory_report.cpp index 68fbd77cdf..9ad5b20152 100644 --- a/layersvt/device_memory_report/device_memory_report.cpp +++ b/layersvt/device_memory_report/device_memory_report.cpp @@ -210,10 +210,12 @@ void DeviceMemoryReport::UpdateAllocationUnboundCounter(uint64_t memory_handle) uint64_t new_unbound = (allocation.total_size > bound_size) ? (allocation.total_size - bound_size) : 0; std::string track_name = "unbound_memory"; - auto res_it = resources_.find(allocation.object_handle); - // If the memory object has an associated resource with a specific usage, use it as the track name. - if (res_it != resources_.end()) { - track_name = res_it->second.GetCluster(allocation.mem_flags); + if (allocation.is_driver) { + auto res_it = resources_.find(allocation.object_handle); + // If the memory object has an associated resource with a specific usage, use it as the track name. + if (res_it != resources_.end()) { + track_name = res_it->second.GetCluster(allocation.mem_flags); + } } std::string new_unbound_track = GetUsageTrackName(allocation.is_driver, track_name); @@ -312,13 +314,19 @@ VkDeviceSize DeviceMemoryReport::GetRecordedResourceSize(uint64_t resource_handl return it != resources_.end() ? it->second.size : 0; } +uint64_t DeviceMemoryReport::GetUsageCounterBytes(const std::string& track) { + std::lock_guard lock(counter_mutex_); + auto it = usage_memory_bytes_.find(track); + return it != usage_memory_bytes_.end() ? it->second : 0; +} + void DeviceMemoryReport::OnCreateImage(uint64_t image_handle, VkImageUsageFlags usage) { std::lock_guard lock(counter_mutex_); auto& res = resources_[image_handle]; res.is_image = true; res.image_usage = usage; for (const auto& pair : memory_allocations_) { - if (pair.second.object_handle == image_handle) { + if (pair.second.is_driver && pair.second.object_handle == image_handle) { UpdateAllocationUnboundCounter(pair.first); } } @@ -331,7 +339,7 @@ void DeviceMemoryReport::OnCreateBuffer(uint64_t buffer_handle, VkBufferUsageFla res.buffer_usage = usage; res.size = size; for (const auto& pair : memory_allocations_) { - if (pair.second.object_handle == buffer_handle) { + if (pair.second.is_driver && pair.second.object_handle == buffer_handle) { UpdateAllocationUnboundCounter(pair.first); } } diff --git a/layersvt/device_memory_report/device_memory_report.h b/layersvt/device_memory_report/device_memory_report.h index 22514516aa..5c23645248 100644 --- a/layersvt/device_memory_report/device_memory_report.h +++ b/layersvt/device_memory_report/device_memory_report.h @@ -170,6 +170,13 @@ class DeviceMemoryReport { */ VkDeviceSize GetRecordedResourceSize(uint64_t resource_handle); + /** + * @brief Retrieves the current total memory bytes recorded on a usage track (for testing). + * @param track The full usage track name (e.g. "vulkan.mem.app.usage.unbound_memory"). + * @return Number of bytes on the track. + */ + uint64_t GetUsageCounterBytes(const std::string& track); + /** * @brief Tracks creation of a Vulkan image and its usage flags. * @param image_handle The 64-bit handle of the Vulkan image. diff --git a/layersvt/test/test_devicememoryreport.cpp b/layersvt/test/test_devicememoryreport.cpp index 6fc6c639b9..80c7eddd6c 100644 --- a/layersvt/test/test_devicememoryreport.cpp +++ b/layersvt/test/test_devicememoryreport.cpp @@ -123,6 +123,10 @@ TEST_F(DeviceMemoryReportTests, EmitEventsAndSubCounters) { cb_data.size = 2048; DeviceMemoryReport::MemoryReportCallback(&cb_data, nullptr); + // Free the driver allocation + cb_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; + DeviceMemoryReport::MemoryReportCallback(&cb_data, nullptr); + // Test direct allocate/free fallbacks VkDevice dummy_device = reinterpret_cast(0x1234); VkDeviceMemory dummy_memory = reinterpret_cast(0x5678); @@ -422,6 +426,61 @@ TEST_F(DeviceMemoryReportTests, StaticCounterTrackLookup) { EXPECT_EQ(dynamic_track_again.Serialize().counter().unit(), perfetto::protos::gen::CounterDescriptor::UNIT_SIZE_BYTES); } +TEST_F(DeviceMemoryReportTests, DriverVsAppUnboundMemoryAttribution) { + TEST_DESCRIPTION("Test that application unbound memory is not misclassified when object handle matches an existing resource handle"); + + InitializeDeviceMemoryReportPerfetto(); + + uint64_t shared_handle = 0xF001; + + // Register a virtual image resource with handle shared_handle + DeviceMemoryReport::Get().OnCreateImage(shared_handle, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); + DeviceMemoryReport::Get().OnRecordResourceSize(shared_handle, 4096); + + // Case 1: Driver allocation where objectHandle is the virtual resource handle + VkDeviceMemoryReportCallbackDataEXT driver_cb = {}; + driver_cb.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT; + driver_cb.flags = VK_DEVICE_MEMORY_REPORT_FLAG_INTERNAL_OBJECT_BIT_EXT; // Driver allocation + driver_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT; + driver_cb.memoryObjectId = 0x8001; + driver_cb.size = 4096; + driver_cb.objectType = VK_OBJECT_TYPE_IMAGE; + driver_cb.objectHandle = shared_handle; + DeviceMemoryReport::MemoryReportCallback(&driver_cb, nullptr); + + // Driver allocation with image handle should be attributed to the color_render_target track + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.color_render_target"), 4096u); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.unbound_memory"), 0u); + + // Clean up driver allocation + driver_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; + DeviceMemoryReport::MemoryReportCallback(&driver_cb, nullptr); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.color_render_target"), 0u); + + // Case 2: Application allocation where VkDeviceMemory handle happens to have the same integer value as shared_handle + VkDeviceMemoryReportCallbackDataEXT app_cb = {}; + app_cb.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT; + app_cb.flags = 0; // Application allocation + app_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT; + app_cb.memoryObjectId = 0x8002; + app_cb.size = 8192; + app_cb.objectType = VK_OBJECT_TYPE_DEVICE_MEMORY; + app_cb.objectHandle = shared_handle; + DeviceMemoryReport::MemoryReportCallback(&app_cb, nullptr); + + // Application allocation should be classified as unbound_memory, NOT color_render_target + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.app.usage.unbound_memory"), 8192u); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.app.usage.color_render_target"), 0u); + + // Clean up application allocation and resource + app_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; + DeviceMemoryReport::MemoryReportCallback(&app_cb, nullptr); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.app.usage.unbound_memory"), 0u); + + DeviceMemoryReport::Get().OnDestroyObject(shared_handle); +} + + TEST_F(DeviceMemoryReportTests, ProactiveMemoryRequirementsQuery) { TEST_DESCRIPTION("Test that the layer proactively queries memory requirements when creating images and buffers"); From ea187cf3dcff55f193b3c42de5dad42e49f2da6c Mon Sep 17 00:00:00 2001 From: Jim Blackler Date: Wed, 16 Sep 2026 14:03:14 +0000 Subject: [PATCH 2/6] device_memory_report: verify object_type is image or buffer before cluster reattribution --- layersvt/device_memory_report/device_memory_report.cpp | 9 ++++++--- layersvt/device_memory_report/device_memory_report.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/layersvt/device_memory_report/device_memory_report.cpp b/layersvt/device_memory_report/device_memory_report.cpp index 9ad5b20152..95f20a2712 100644 --- a/layersvt/device_memory_report/device_memory_report.cpp +++ b/layersvt/device_memory_report/device_memory_report.cpp @@ -210,7 +210,9 @@ void DeviceMemoryReport::UpdateAllocationUnboundCounter(uint64_t memory_handle) uint64_t new_unbound = (allocation.total_size > bound_size) ? (allocation.total_size - bound_size) : 0; std::string track_name = "unbound_memory"; - if (allocation.is_driver) { + if (allocation.is_driver && + (allocation.object_type == VK_OBJECT_TYPE_IMAGE || + allocation.object_type == VK_OBJECT_TYPE_BUFFER)) { auto res_it = resources_.find(allocation.object_handle); // If the memory object has an associated resource with a specific usage, use it as the track name. if (res_it != resources_.end()) { @@ -326,7 +328,7 @@ void DeviceMemoryReport::OnCreateImage(uint64_t image_handle, VkImageUsageFlags res.is_image = true; res.image_usage = usage; for (const auto& pair : memory_allocations_) { - if (pair.second.is_driver && pair.second.object_handle == image_handle) { + if (pair.second.is_driver && pair.second.object_type == VK_OBJECT_TYPE_IMAGE && pair.second.object_handle == image_handle) { UpdateAllocationUnboundCounter(pair.first); } } @@ -339,7 +341,7 @@ void DeviceMemoryReport::OnCreateBuffer(uint64_t buffer_handle, VkBufferUsageFla res.buffer_usage = usage; res.size = size; for (const auto& pair : memory_allocations_) { - if (pair.second.is_driver && pair.second.object_handle == buffer_handle) { + if (pair.second.is_driver && pair.second.object_type == VK_OBJECT_TYPE_BUFFER && pair.second.object_handle == buffer_handle) { UpdateAllocationUnboundCounter(pair.first); } } @@ -363,6 +365,7 @@ void DeviceMemoryReport::OnMemoryReportEvent(const VkDeviceMemoryReportCallbackD auto& allocation = memory_allocations_[key]; allocation.total_size = pCallbackData->size; allocation.is_driver = (pCallbackData->flags & VK_DEVICE_MEMORY_REPORT_FLAG_INTERNAL_OBJECT_BIT_EXT) != 0; + allocation.object_type = pCallbackData->objectType; allocation.object_handle = pCallbackData->objectHandle; UpdateAllocationUnboundCounter(key); } else if (pCallbackData->type == VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT || diff --git a/layersvt/device_memory_report/device_memory_report.h b/layersvt/device_memory_report/device_memory_report.h index 5c23645248..8fd86ce61a 100644 --- a/layersvt/device_memory_report/device_memory_report.h +++ b/layersvt/device_memory_report/device_memory_report.h @@ -216,6 +216,7 @@ class DeviceMemoryReport { VkDeviceSize total_size = 0; VkDeviceSize applied_unbound_bytes = 0; bool is_driver = false; + VkObjectType object_type = VK_OBJECT_TYPE_UNKNOWN; VkMemoryPropertyFlags mem_flags = 0; std::vector sub_allocations; std::string unbound_usage_track; From 4e7e5186085464a109de9165cb0ce056e9d7c743 Mon Sep 17 00:00:00 2001 From: Jim Blackler Date: Wed, 16 Sep 2026 14:03:29 +0000 Subject: [PATCH 3/6] device_memory_report: clarify GetUsageCounterBytes return doc --- layersvt/device_memory_report/device_memory_report.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layersvt/device_memory_report/device_memory_report.h b/layersvt/device_memory_report/device_memory_report.h index 8fd86ce61a..8a30d438a6 100644 --- a/layersvt/device_memory_report/device_memory_report.h +++ b/layersvt/device_memory_report/device_memory_report.h @@ -173,7 +173,7 @@ class DeviceMemoryReport { /** * @brief Retrieves the current total memory bytes recorded on a usage track (for testing). * @param track The full usage track name (e.g. "vulkan.mem.app.usage.unbound_memory"). - * @return Number of bytes on the track. + * @return Number of bytes currently recorded on the track, or 0 if the track has no counter. */ uint64_t GetUsageCounterBytes(const std::string& track); From b64cced99d86877ea209fb70cde9a11962f446b1 Mon Sep 17 00:00:00 2001 From: Jim Blackler Date: Wed, 16 Sep 2026 14:04:07 +0000 Subject: [PATCH 4/6] test: verify driver unbound memory counter drops to zero on free --- layersvt/test/test_devicememoryreport.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/layersvt/test/test_devicememoryreport.cpp b/layersvt/test/test_devicememoryreport.cpp index 80c7eddd6c..6c63133f0d 100644 --- a/layersvt/test/test_devicememoryreport.cpp +++ b/layersvt/test/test_devicememoryreport.cpp @@ -126,6 +126,7 @@ TEST_F(DeviceMemoryReportTests, EmitEventsAndSubCounters) { // Free the driver allocation cb_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; DeviceMemoryReport::MemoryReportCallback(&cb_data, nullptr); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.unbound_memory"), 0u); // Test direct allocate/free fallbacks VkDevice dummy_device = reinterpret_cast(0x1234); From 8a7d3c8eed98cf83af55b4ecc429831491aa52fb Mon Sep 17 00:00:00 2001 From: Jim Blackler Date: Wed, 16 Sep 2026 14:05:59 +0000 Subject: [PATCH 5/6] test: use descriptive variable names for callback data --- layersvt/test/test_devicememoryreport.cpp | 44 +++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/layersvt/test/test_devicememoryreport.cpp b/layersvt/test/test_devicememoryreport.cpp index 6c63133f0d..0ec6b342b2 100644 --- a/layersvt/test/test_devicememoryreport.cpp +++ b/layersvt/test/test_devicememoryreport.cpp @@ -439,43 +439,43 @@ TEST_F(DeviceMemoryReportTests, DriverVsAppUnboundMemoryAttribution) { DeviceMemoryReport::Get().OnRecordResourceSize(shared_handle, 4096); // Case 1: Driver allocation where objectHandle is the virtual resource handle - VkDeviceMemoryReportCallbackDataEXT driver_cb = {}; - driver_cb.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT; - driver_cb.flags = VK_DEVICE_MEMORY_REPORT_FLAG_INTERNAL_OBJECT_BIT_EXT; // Driver allocation - driver_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT; - driver_cb.memoryObjectId = 0x8001; - driver_cb.size = 4096; - driver_cb.objectType = VK_OBJECT_TYPE_IMAGE; - driver_cb.objectHandle = shared_handle; - DeviceMemoryReport::MemoryReportCallback(&driver_cb, nullptr); + VkDeviceMemoryReportCallbackDataEXT driver_callback_data = {}; + driver_callback_data.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT; + driver_callback_data.flags = VK_DEVICE_MEMORY_REPORT_FLAG_INTERNAL_OBJECT_BIT_EXT; // Driver allocation + driver_callback_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT; + driver_callback_data.memoryObjectId = 0x8001; + driver_callback_data.size = 4096; + driver_callback_data.objectType = VK_OBJECT_TYPE_IMAGE; + driver_callback_data.objectHandle = shared_handle; + DeviceMemoryReport::MemoryReportCallback(&driver_callback_data, nullptr); // Driver allocation with image handle should be attributed to the color_render_target track EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.color_render_target"), 4096u); EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.unbound_memory"), 0u); // Clean up driver allocation - driver_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; - DeviceMemoryReport::MemoryReportCallback(&driver_cb, nullptr); + driver_callback_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; + DeviceMemoryReport::MemoryReportCallback(&driver_callback_data, nullptr); EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.color_render_target"), 0u); // Case 2: Application allocation where VkDeviceMemory handle happens to have the same integer value as shared_handle - VkDeviceMemoryReportCallbackDataEXT app_cb = {}; - app_cb.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT; - app_cb.flags = 0; // Application allocation - app_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT; - app_cb.memoryObjectId = 0x8002; - app_cb.size = 8192; - app_cb.objectType = VK_OBJECT_TYPE_DEVICE_MEMORY; - app_cb.objectHandle = shared_handle; - DeviceMemoryReport::MemoryReportCallback(&app_cb, nullptr); + VkDeviceMemoryReportCallbackDataEXT application_callback_data = {}; + application_callback_data.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT; + application_callback_data.flags = 0; // Application allocation + application_callback_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT; + application_callback_data.memoryObjectId = 0x8002; + application_callback_data.size = 8192; + application_callback_data.objectType = VK_OBJECT_TYPE_DEVICE_MEMORY; + application_callback_data.objectHandle = shared_handle; + DeviceMemoryReport::MemoryReportCallback(&application_callback_data, nullptr); // Application allocation should be classified as unbound_memory, NOT color_render_target EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.app.usage.unbound_memory"), 8192u); EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.app.usage.color_render_target"), 0u); // Clean up application allocation and resource - app_cb.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; - DeviceMemoryReport::MemoryReportCallback(&app_cb, nullptr); + application_callback_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; + DeviceMemoryReport::MemoryReportCallback(&application_callback_data, nullptr); EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.app.usage.unbound_memory"), 0u); DeviceMemoryReport::Get().OnDestroyObject(shared_handle); From 51ff9610adcad43c6851d7f82772c3d496bfc8ab Mon Sep 17 00:00:00 2001 From: Jim Blackler Date: Wed, 16 Sep 2026 14:09:59 +0000 Subject: [PATCH 6/6] test: add Case 3 to test driver allocation arriving before OnCreateBuffer --- layersvt/test/test_devicememoryreport.cpp | 28 ++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/layersvt/test/test_devicememoryreport.cpp b/layersvt/test/test_devicememoryreport.cpp index 0ec6b342b2..5efa12044c 100644 --- a/layersvt/test/test_devicememoryreport.cpp +++ b/layersvt/test/test_devicememoryreport.cpp @@ -479,8 +479,34 @@ TEST_F(DeviceMemoryReportTests, DriverVsAppUnboundMemoryAttribution) { EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.app.usage.unbound_memory"), 0u); DeviceMemoryReport::Get().OnDestroyObject(shared_handle); -} + // Case 3: Driver allocation arrives before OnCreateBuffer (tests re-attribution) + uint64_t buffer_handle = 0xF002; + VkDeviceMemoryReportCallbackDataEXT buffer_callback_data = {}; + buffer_callback_data.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT; + buffer_callback_data.flags = VK_DEVICE_MEMORY_REPORT_FLAG_INTERNAL_OBJECT_BIT_EXT; + buffer_callback_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT; + buffer_callback_data.memoryObjectId = 0x8003; + buffer_callback_data.size = 4096; + buffer_callback_data.objectType = VK_OBJECT_TYPE_BUFFER; + buffer_callback_data.objectHandle = buffer_handle; + DeviceMemoryReport::MemoryReportCallback(&buffer_callback_data, nullptr); + + // Prior to OnCreateBuffer, the driver allocation is counted under unbound_memory + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.unbound_memory"), 4096u); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.geometry_mesh"), 0u); + + // When the buffer is created, the allocation is re-attributed to the geometry_mesh cluster + DeviceMemoryReport::Get().OnCreateBuffer(buffer_handle, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, 4096); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.unbound_memory"), 0u); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.geometry_mesh"), 4096u); + + // Clean up + buffer_callback_data.type = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT; + DeviceMemoryReport::MemoryReportCallback(&buffer_callback_data, nullptr); + EXPECT_EQ(DeviceMemoryReport::Get().GetUsageCounterBytes("vulkan.mem.driver.usage.geometry_mesh"), 0u); + DeviceMemoryReport::Get().OnDestroyObject(buffer_handle); +} TEST_F(DeviceMemoryReportTests, ProactiveMemoryRequirementsQuery) { TEST_DESCRIPTION("Test that the layer proactively queries memory requirements when creating images and buffers");