wsi: Label the WSI blit command buffer with a name.

Given that the command buffer will be long-lived, no reason not to just do
this so that debugging tools can see what the cmdbuf is doing.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22350>
This commit is contained in:
Emma Anholt 2023-04-04 14:36:35 -07:00 committed by Marge Bot
parent 600892802d
commit 188bd800c2
2 changed files with 18 additions and 0 deletions

View file

@ -205,6 +205,7 @@ wsi_device_init(struct wsi_device *wsi,
WSI_GET_CB(GetSemaphoreFdKHR);
WSI_GET_CB(ResetFences);
WSI_GET_CB(QueueSubmit);
WSI_GET_CB(SetDebugUtilsObjectNameEXT);
WSI_GET_CB(WaitForFences);
WSI_GET_CB(MapMemory);
WSI_GET_CB(UnmapMemory);
@ -1905,6 +1906,20 @@ wsi_create_buffer_blit_context(const struct wsi_swapchain *chain,
return VK_SUCCESS;
}
static void
wsi_label_cmd_buffer(const struct wsi_device *wsi, VkDevice device, VkCommandBuffer cmd_buffer, const char *name)
{
VkDebugUtilsObjectNameInfoEXT name_info = {
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
.pNext = NULL,
.objectType = VK_OBJECT_TYPE_COMMAND_BUFFER,
.objectHandle = (uintptr_t)cmd_buffer,
.pObjectName = name,
};
wsi->SetDebugUtilsObjectNameEXT(device, &name_info);
}
VkResult
wsi_finish_create_blit_context(const struct wsi_swapchain *chain,
const struct wsi_image_info *info,
@ -1938,6 +1953,8 @@ wsi_finish_create_blit_context(const struct wsi_swapchain *chain,
if (result != VK_SUCCESS)
return result;
wsi_label_cmd_buffer(wsi, chain->device, image->blit.cmd_buffers[i], "wsi blit");
const VkCommandBufferBeginInfo begin_info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
};

View file

@ -273,6 +273,7 @@ struct wsi_device {
WSI_CB(GetSemaphoreFdKHR);
WSI_CB(ResetFences);
WSI_CB(QueueSubmit);
WSI_CB(SetDebugUtilsObjectNameEXT);
WSI_CB(WaitForFences);
WSI_CB(MapMemory);
WSI_CB(UnmapMemory);