mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
vulkan/debug_utils: add a helper for reporting address binding
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28373>
This commit is contained in:
parent
24a5165cdf
commit
34e8e5d76f
2 changed files with 45 additions and 0 deletions
|
|
@ -82,6 +82,44 @@ vk_debug_message_instance(struct vk_instance *instance,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
vk_address_binding_report(struct vk_instance *instance,
|
||||||
|
struct vk_object_base *object,
|
||||||
|
uint64_t base_address,
|
||||||
|
uint64_t size,
|
||||||
|
VkDeviceAddressBindingTypeEXT type)
|
||||||
|
{
|
||||||
|
if (list_is_empty(&instance->debug_utils.instance_callbacks))
|
||||||
|
return;
|
||||||
|
|
||||||
|
VkDeviceAddressBindingCallbackDataEXT addr_binding = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT,
|
||||||
|
.flags = object->client_visible ? 0 : VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT,
|
||||||
|
.baseAddress = base_address,
|
||||||
|
.size = size,
|
||||||
|
.bindingType = type,
|
||||||
|
};
|
||||||
|
|
||||||
|
VkDebugUtilsObjectNameInfoEXT object_name_info = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
|
||||||
|
.pNext = NULL,
|
||||||
|
.objectType = object->type,
|
||||||
|
.objectHandle = (uint64_t)(uintptr_t)object,
|
||||||
|
.pObjectName = object->object_name,
|
||||||
|
};
|
||||||
|
|
||||||
|
VkDebugUtilsMessengerCallbackDataEXT cb_data = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT,
|
||||||
|
.pNext = &addr_binding,
|
||||||
|
.objectCount = 1,
|
||||||
|
.pObjects = &object_name_info,
|
||||||
|
};
|
||||||
|
|
||||||
|
vk_debug_message(instance, VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT,
|
||||||
|
VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT,
|
||||||
|
&cb_data);
|
||||||
|
}
|
||||||
|
|
||||||
VKAPI_ATTR VkResult VKAPI_CALL
|
VKAPI_ATTR VkResult VKAPI_CALL
|
||||||
vk_common_CreateDebugUtilsMessengerEXT(
|
vk_common_CreateDebugUtilsMessengerEXT(
|
||||||
VkInstance _instance,
|
VkInstance _instance,
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,13 @@ vk_debug_message_instance(struct vk_instance *instance,
|
||||||
int32_t messageIdNumber,
|
int32_t messageIdNumber,
|
||||||
const char *pMessage);
|
const char *pMessage);
|
||||||
|
|
||||||
|
void
|
||||||
|
vk_address_binding_report(struct vk_instance *instance,
|
||||||
|
struct vk_object_base *object,
|
||||||
|
uint64_t base_address,
|
||||||
|
uint64_t size,
|
||||||
|
VkDeviceAddressBindingTypeEXT type);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue