vulkan: handle device memory report requests
Add memory_report to vk_device and init it when create vk device to handle device memory report requests. Signed-off-by: Julia Zhang <julia.zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33088>
This commit is contained in:
@@ -121,6 +121,30 @@ vk_address_binding_report(struct vk_instance *instance,
|
||||
&cb_data);
|
||||
}
|
||||
|
||||
void
|
||||
vk_emit_device_memory_report(struct vk_device* device,
|
||||
VkDeviceMemoryReportEventTypeEXT type,
|
||||
uint64_t mem_obj_id,
|
||||
VkDeviceSize size,
|
||||
uint64_t obj_handle,
|
||||
uint32_t heap_index)
|
||||
{
|
||||
assert(device->memory_reports);
|
||||
|
||||
const VkDeviceMemoryReportCallbackDataEXT report = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT,
|
||||
.type = type,
|
||||
.memoryObjectId = mem_obj_id,
|
||||
.size = size,
|
||||
.objectType = VK_OBJECT_TYPE_DEVICE_MEMORY,
|
||||
.objectHandle = obj_handle,
|
||||
.heapIndex = heap_index,
|
||||
};
|
||||
|
||||
for (uint32_t i = 0; i < device->memory_report_count; i++)
|
||||
device->memory_reports[i].callback(&report, device->memory_reports[i].data);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
vk_common_CreateDebugUtilsMessengerEXT(
|
||||
VkInstance _instance,
|
||||
|
||||
Reference in New Issue
Block a user