diff --git a/src/intel/dev/intel_debug.c b/src/intel/dev/intel_debug.c index d98ea35ddc3..d6b02960248 100644 --- a/src/intel/dev/intel_debug.c +++ b/src/intel/dev/intel_debug.c @@ -108,6 +108,7 @@ static const struct debug_control_bitset debug_control[] = { OPT1("bvh_tlas_ir_hdr", DEBUG_BVH_TLAS_IR_HDR), OPT1("bvh_blas_ir_as", DEBUG_BVH_BLAS_IR_AS), OPT1("bvh_tlas_ir_as", DEBUG_BVH_TLAS_IR_AS), + OPT1("bvh_pcrel_map", DEBUG_BVH_PCREL_MAP), OPT1("bvh_no_build", DEBUG_BVH_NO_BUILD), OPT1("task", DEBUG_TASK), OPT1("mesh", DEBUG_MESH), diff --git a/src/intel/dev/intel_debug.h b/src/intel/dev/intel_debug.h index 345749fd5f6..79d76dc6e88 100644 --- a/src/intel/dev/intel_debug.h +++ b/src/intel/dev/intel_debug.h @@ -94,6 +94,7 @@ enum intel_debug_flag { DEBUG_BVH_TLAS_IR_HDR, DEBUG_BVH_BLAS_IR_AS, DEBUG_BVH_TLAS_IR_AS, + DEBUG_BVH_PCREL_MAP, DEBUG_BVH_NO_BUILD, DEBUG_NO_SEND_GATHER, DEBUG_NO_VRT, @@ -134,7 +135,8 @@ extern BITSET_WORD intel_debug[BITSET_WORDS(INTEL_DEBUG_MAX)]; INTEL_DEBUG(DEBUG_BVH_BLAS_IR_HDR) || \ INTEL_DEBUG(DEBUG_BVH_TLAS_IR_HDR) || \ INTEL_DEBUG(DEBUG_BVH_BLAS_IR_AS) || \ - INTEL_DEBUG(DEBUG_BVH_TLAS_IR_AS))) + INTEL_DEBUG(DEBUG_BVH_TLAS_IR_AS) || \ + INTEL_DEBUG(DEBUG_BVH_PCREL_MAP))) extern uint64_t intel_simd; extern uint32_t intel_debug_bkp_before_draw_count; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 9128207936c..5f458e22340 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2564,7 +2564,8 @@ enum anv_object_key_bvh_type { enum bvh_dump_type { BVH_ANV, BVH_IR_HDR, - BVH_IR_AS + BVH_IR_AS, + BVH_ANV_PCREL, }; struct anv_bvh_dump { diff --git a/src/intel/vulkan/anv_util.c b/src/intel/vulkan/anv_util.c index 583baf4c6d3..f02a4f09875 100644 --- a/src/intel/vulkan/anv_util.c +++ b/src/intel/vulkan/anv_util.c @@ -292,6 +292,9 @@ create_bvh_dump_file(struct anv_bvh_dump *bvh) case BVH_IR_AS: dump_sub_directory = "BVH_IR_AS"; break; + case BVH_ANV_PCREL: + dump_sub_directory = "BVH_ANV_PCREL"; + break; default: UNREACHABLE("invalid dump type"); } diff --git a/src/intel/vulkan/genX_acceleration_structure.c b/src/intel/vulkan/genX_acceleration_structure.c index ae1ae3c435c..b7ab269cb79 100644 --- a/src/intel/vulkan/genX_acceleration_structure.c +++ b/src/intel/vulkan/genX_acceleration_structure.c @@ -150,21 +150,29 @@ add_bvh_dump(struct anv_cmd_buffer *cmd_buffer, static void debug_record_as_to_bvh_dump(struct anv_cmd_buffer *cmd_buffer, VkDeviceAddress header_addr, - uint64_t bvh_anv_size, + struct bvh_layout bvh_layout, VkDeviceAddress intermediate_header_addr, VkDeviceAddress intermediate_as_addr, uint32_t leaf_count, VkGeometryTypeKHR geometry_type) { + if (INTEL_DEBUG(DEBUG_BVH_PCREL_MAP) && + geometry_type != VK_GEOMETRY_TYPE_INSTANCES_KHR) { + add_bvh_dump(cmd_buffer, header_addr + bvh_layout.parent_child_map_offset, + bvh_layout.leaf_block_map_offset - bvh_layout.parent_child_map_offset, + geometry_type, + BVH_ANV_PCREL); + } + if (INTEL_DEBUG(DEBUG_BVH_BLAS) && geometry_type != VK_GEOMETRY_TYPE_INSTANCES_KHR) { - add_bvh_dump(cmd_buffer, header_addr, bvh_anv_size, geometry_type, + add_bvh_dump(cmd_buffer, header_addr, bvh_layout.size, geometry_type, BVH_ANV); } if (INTEL_DEBUG(DEBUG_BVH_TLAS) && geometry_type == VK_GEOMETRY_TYPE_INSTANCES_KHR) { - add_bvh_dump(cmd_buffer, header_addr, bvh_anv_size, geometry_type, + add_bvh_dump(cmd_buffer, header_addr, bvh_layout.size, geometry_type, BVH_ANV); } @@ -489,7 +497,7 @@ anv_init_header(VkCommandBuffer commandBuffer, const struct vk_acceleration_stru vk_common_CmdDispatch(commandBuffer, 1, 1, 1); if (INTEL_DEBUG_BVH_ANY) { - debug_record_as_to_bvh_dump(cmd_buffer, header_addr, bvh_layout.size, + debug_record_as_to_bvh_dump(cmd_buffer, header_addr, bvh_layout, intermediate_header_addr, intermediate_bvh_addr, state->leaf_node_count, geometry_type); }