Commit 91d00cba authored by Eric Engestrom's avatar Eric Engestrom 💤
Browse files

anv: track heap usage


Signed-off-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
parent d507bcdc
Pipeline #29467 passed with stages
in 27 minutes and 16 seconds
......@@ -2683,6 +2683,8 @@ VkResult anv_AllocateMemory(
success:
*pMem = anv_device_memory_to_handle(mem);
pdevice->memory.heaps[mem->type->heapIndex].used += mem->bo->size;
return VK_SUCCESS;
fail:
......@@ -2768,6 +2770,7 @@ void anv_FreeMemory(
{
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_device_memory, mem, _mem);
struct anv_physical_device *pdevice = &device->instance->physicalDevice;
if (mem == NULL)
return;
......@@ -2782,6 +2785,8 @@ void anv_FreeMemory(
AHardwareBuffer_release(mem->ahw);
#endif
pdevice->memory.heaps[mem->type->heapIndex].used -= mem->bo->size;
vk_free2(&device->alloc, pAllocator, mem);
}
......
......@@ -902,6 +902,7 @@ struct anv_memory_heap {
/* Driver-internal book-keeping */
bool supports_48bit_addresses;
VkDeviceSize used;
};
struct anv_physical_device {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment