diff --git a/src/intel/vulkan/bvh/anv_build_interface.h b/src/intel/vulkan/bvh/anv_build_interface.h index eb393553521..850fa942105 100644 --- a/src/intel/vulkan/bvh/anv_build_interface.h +++ b/src/intel/vulkan/bvh/anv_build_interface.h @@ -67,6 +67,11 @@ struct header_args { uint64_t bvh_size; uint8_t is_compacted; + + uint64_t parent_child_map_offset; + uint64_t leaf_block_map_offset; + uint32_t leaf_count; + uint32_t total_nodes; }; #define ANV_COPY_MODE_COPY 0 diff --git a/src/intel/vulkan/bvh/anv_bvh.h b/src/intel/vulkan/bvh/anv_bvh.h index 3f24fb456a2..264c5d6eb73 100644 --- a/src/intel/vulkan/bvh/anv_bvh.h +++ b/src/intel/vulkan/bvh/anv_bvh.h @@ -76,7 +76,12 @@ struct anv_accel_struct_header { uint32_t instance_leaves_offset; - uint32_t padding[40]; + uint64_t parent_child_map_offset; + uint64_t leaf_block_map_offset; + uint32_t leaf_count; + uint32_t total_nodes; + + uint32_t padding[34]; }; /* Mixed internal node with type per child */ diff --git a/src/intel/vulkan/bvh/header.comp b/src/intel/vulkan/bvh/header.comp index 4235a1025c0..0069c0d6641 100644 --- a/src/intel/vulkan/bvh/header.comp +++ b/src/intel/vulkan/bvh/header.comp @@ -34,6 +34,11 @@ main(void) DEREF(args.dst).instance_count = args.instance_count; DEREF(args.dst).instance_leaves_offset = args.instance_leaves_offset; + DEREF(args.dst).parent_child_map_offset = args.parent_child_map_offset, + DEREF(args.dst).leaf_block_map_offset = args.leaf_block_map_offset, + DEREF(args.dst).leaf_count = args.leaf_count, + DEREF(args.dst).total_nodes = args.total_nodes, + /* 128 is local_size_x in copy.comp shader, 16bytes is the amount of data * copied by each iteration of that shader's loop */ diff --git a/src/intel/vulkan/genX_acceleration_structure.c b/src/intel/vulkan/genX_acceleration_structure.c index 6d09f1efe10..8d9d8d19590 100644 --- a/src/intel/vulkan/genX_acceleration_structure.c +++ b/src/intel/vulkan/genX_acceleration_structure.c @@ -542,6 +542,11 @@ anv_init_header(VkCommandBuffer commandBuffer, const struct vk_acceleration_stru .instance_leaves_offset = bvh_layout.instance_leaves_offset, .is_compacted = (state->config.encode_key[0] == 1), .bvh_size = bvh_layout.size, + + .parent_child_map_offset = bvh_layout.parent_child_map_offset, + .leaf_block_map_offset = bvh_layout.leaf_block_map_offset, + .leaf_count = state->leaf_node_count, + .total_nodes = state->leaf_node_count + (MAX2(state->leaf_node_count, 2) - 1), }; anv_bvh_build_set_args(commandBuffer, &args, sizeof(args));