Name most vulkan objects

This commit is contained in:
Patrick Nicolas
2025-06-12 15:46:37 +02:00
parent 1ed4d3cfe6
commit f6eb528ea7
5 changed files with 15 additions and 0 deletions
+6
View File
@@ -235,6 +235,7 @@ static VkResult create_images(struct wivrn_comp_target * cn, vk::ImageUsageFlags
.usage = VMA_MEMORY_USAGE_AUTO, .usage = VMA_MEMORY_USAGE_AUTO,
}); });
cn->images[i].handle = image; cn->images[i].handle = image;
cn->wivrn_bundle->name(vk::Image(image), "comp target image");
} }
for (uint32_t i = 0; i < cn->image_count; i++) for (uint32_t i = 0; i < cn->image_count; i++)
@@ -269,13 +270,17 @@ static VkResult create_images(struct wivrn_comp_target * cn, vk::ImageUsageFlags
}); });
cn->images[i].view = VkImageView(*item.image_view_y); cn->images[i].view = VkImageView(*item.image_view_y);
cn->images[i].view_cbcr = VkImageView(*item.image_view_cbcr); cn->images[i].view_cbcr = VkImageView(*item.image_view_cbcr);
cn->wivrn_bundle->name(item.image_view_y, "comp target image view (y)");
cn->wivrn_bundle->name(item.image_view_cbcr, "comp target image view (CbCr)");
} }
cn->psc.fence = vk::raii::Fence(device, vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled}); cn->psc.fence = vk::raii::Fence(device, vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled});
cn->wivrn_bundle->name(cn->psc.fence, "comp target fence");
cn->psc.command_buffer = std::move(device.allocateCommandBuffers( cn->psc.command_buffer = std::move(device.allocateCommandBuffers(
{.commandPool = *cn->command_pool, {.commandPool = *cn->command_pool,
.commandBufferCount = 1})[0]); .commandBufferCount = 1})[0]);
cn->wivrn_bundle->name(cn->psc.command_buffer, "comp target command buffer");
return VK_SUCCESS; return VK_SUCCESS;
} }
@@ -300,6 +305,7 @@ static bool comp_wivrn_init_post_vulkan(struct comp_target * ct, uint32_t prefer
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer, .flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer,
.queueFamilyIndex = vk->queue_family_index, .queueFamilyIndex = vk->queue_family_index,
}); });
cn->wivrn_bundle->name(cn->command_pool, "comp target command pool");
} }
catch (std::exception & e) catch (std::exception & e)
{ {
+3
View File
@@ -273,6 +273,9 @@ wivrn_foveation::wivrn_foveation(wivrn_vk_bundle & bundle, const xrt_hmd_parts &
.usage = VMA_MEMORY_USAGE_AUTO, .usage = VMA_MEMORY_USAGE_AUTO,
}) })
{ {
bundle.name(command_pool, "foveation command pool");
bundle.name(cmd, "foveation command buffer");
bundle.name(vk::Buffer(host_buffer), "foveation staging buffer");
} }
void wivrn_foveation::update_tracking(const from_headset::tracking & tracking, const clock_offset & offset) void wivrn_foveation::update_tracking(const from_headset::tracking & tracking, const clock_offset & offset)
@@ -311,6 +311,7 @@ video_encoder_va::video_encoder_va(wivrn_vk_bundle & vk,
auto & image = (i == 0 ? luma : chroma); auto & image = (i == 0 ? luma : chroma);
image = vk.device.createImage(image_create_info.get()); image = vk.device.createImage(image_create_info.get());
vk.name(image, i == 0 ? "va encoder luma image" : "va encoder chroma image");
auto [req, ded_req] = vk.device.getImageMemoryRequirements2<vk::MemoryRequirements2, vk::MemoryDedicatedRequirements>({.image = *image}); auto [req, ded_req] = vk.device.getImageMemoryRequirements2<vk::MemoryRequirements2, vk::MemoryDedicatedRequirements>({.image = *image});
@@ -336,6 +337,7 @@ video_encoder_va::video_encoder_va(wivrn_vk_bundle & vk,
try try
{ {
mem.emplace_back(vk.device, alloc_info.get()); mem.emplace_back(vk.device, alloc_info.get());
vk.name(mem.back(), "va encoder memory");
} }
catch (...) catch (...)
{ {
+2
View File
@@ -248,6 +248,7 @@ video_encoder_nvenc::video_encoder_nvenc(
for (auto & i: in) for (auto & i: in)
{ {
i.yuv = vk::raii::Buffer(vk.device, buffer_create_info.get()); i.yuv = vk::raii::Buffer(vk.device, buffer_create_info.get());
vk.name(i.yuv, "nvenc yuv buffer");
auto memory_req = i.yuv.getMemoryRequirements(); auto memory_req = i.yuv.getMemoryRequirements();
vk::StructureChain mem_info{ vk::StructureChain mem_info{
@@ -263,6 +264,7 @@ video_encoder_nvenc::video_encoder_nvenc(
}, },
}; };
i.mem = vk.device.allocateMemory(mem_info.get()); i.mem = vk.device.allocateMemory(mem_info.get());
vk.name(i.mem, "nvenc memory");
i.yuv.bindMemory(*i.mem, 0); i.yuv.bindMemory(*i.mem, 0);
int fd = vk.device.getMemoryFdKHR({ int fd = vk.device.getMemoryFdKHR({
+2
View File
@@ -175,6 +175,8 @@ video_encoder_x264::video_encoder_x264(
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT, .flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
.usage = VMA_MEMORY_USAGE_AUTO, .usage = VMA_MEMORY_USAGE_AUTO,
}); });
vk.name(vk::Buffer(i.luma), "x264 luma buffer");
vk.name(vk::Buffer(i.chroma), "x264 chroma buffer");
auto & pic = i.pic; auto & pic = i.pic;
x264_picture_init(&pic); x264_picture_init(&pic);