From 9ba7005d251bf3da0abce23e21f2771675d5398a Mon Sep 17 00:00:00 2001 From: Michael Cheng Date: Fri, 28 Feb 2025 15:11:10 -0800 Subject: [PATCH] vulkan : Pass in number of tlas/blas being built Pass the counts for top-level and bottom-level acceleration structures to the debug_marker. Signed-off-by: Michael Cheng Reviewed-by: Konstantin Seurer Reviewed-by: Lionel Landwerlin Part-of: --- .../runtime/vk_acceleration_structure.c | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/vulkan/runtime/vk_acceleration_structure.c b/src/vulkan/runtime/vk_acceleration_structure.c index 93f5775ee67..2533f47887d 100644 --- a/src/vulkan/runtime/vk_acceleration_structure.c +++ b/src/vulkan/runtime/vk_acceleration_structure.c @@ -1025,10 +1025,24 @@ vk_cmd_build_acceleration_structures(VkCommandBuffer commandBuffer, struct bvh_state *bvh_states = calloc(infoCount, sizeof(struct bvh_state)); if (args->emit_markers) { - device->as_build_ops->begin_debug_marker(commandBuffer, - VK_ACCELERATION_STRUCTURE_BUILD_STEP_TOP, - "vkCmdBuildAccelerationStructuresKHR(%u)", - infoCount); + uint32_t num_of_blas = 0; + uint32_t num_of_tlas = 0; + for (uint32_t i = 0; i < infoCount; ++i) { + switch (pInfos[i].type) { + case VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR: + num_of_tlas++; + break; + case VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR: + num_of_blas++; + break; + default: + break; + } + } + ops->begin_debug_marker(commandBuffer, + VK_ACCELERATION_STRUCTURE_BUILD_STEP_TOP, + "vkCmdBuildAccelerationStructuresKHR() TLAS(%u) BLAS(%u)", + num_of_tlas, num_of_blas); } for (uint32_t i = 0; i < infoCount; ++i) {