diff --git a/src/amd/vulkan/bvh/build_interface.h b/src/amd/vulkan/bvh/build_interface.h index aaf6157b5dd..a868a0a5449 100644 --- a/src/amd/vulkan/bvh/build_interface.h +++ b/src/amd/vulkan/bvh/build_interface.h @@ -62,7 +62,7 @@ struct lbvh_internal_args { REF(key_id_pair) src_ids; REF(key_id_pair) dst_ids; uint32_t dst_offset; - uint32_t is_root_and_count; + uint32_t src_count; }; #define RADV_COPY_MODE_COPY 0 diff --git a/src/amd/vulkan/bvh/bvh.h b/src/amd/vulkan/bvh/bvh.h index 2f042b69916..c1359dbff3f 100644 --- a/src/amd/vulkan/bvh/bvh.h +++ b/src/amd/vulkan/bvh/bvh.h @@ -81,8 +81,6 @@ struct radv_accel_struct_header { }; struct radv_ir_node { - float sah_cost; - uint32_t parent; float aabb[2][3]; }; diff --git a/src/amd/vulkan/bvh/lbvh_internal.comp b/src/amd/vulkan/bvh/lbvh_internal.comp index 405bc3f0afe..74ec91b36dd 100644 --- a/src/amd/vulkan/bvh/lbvh_internal.comp +++ b/src/amd/vulkan/bvh/lbvh_internal.comp @@ -46,11 +46,8 @@ main(void) { uint32_t global_id = gl_GlobalInvocationID.x; - bool is_root_node = (args.is_root_and_count & 0x80000000u) != 0; - uint32_t src_count = args.is_root_and_count & 0x7FFFFFFFu; - uint32_t src_index = global_id * 2; - uint32_t child_count = min(src_count - src_index, 2); + uint32_t child_count = min(args.src_count - src_index, 2); uint32_t dst_offset = args.dst_offset + global_id * SIZEOF(radv_ir_box_node); uint32_t current_id = pack_ir_node_id(dst_offset, radv_ir_node_internal); @@ -77,8 +74,6 @@ main(void) total_bounds.min = min(total_bounds.min, bounds.min); total_bounds.max = max(total_bounds.max, bounds.max); is_active = true; - - DEREF(child).parent = current_id; } else { child_id = NULL_NODE_ID; } @@ -96,9 +91,4 @@ main(void) * id to NULL_NODE_ID for more internal nodes to become inactive. */ DEREF(INDEX(key_id_pair, args.dst_ids, global_id)).id = is_active ? current_id : NULL_NODE_ID; - - if (is_root_node) { - /* We're writing the root node, which doesn't have a parent */ - DEREF(dst_node).base.parent = 0xFFFFFFFF; - } } diff --git a/src/amd/vulkan/radv_acceleration_structure.c b/src/amd/vulkan/radv_acceleration_structure.c index 837c172602b..8f85cd4e868 100644 --- a/src/amd/vulkan/radv_acceleration_structure.c +++ b/src/amd/vulkan/radv_acceleration_structure.c @@ -628,7 +628,6 @@ lbvh_build_internal(VkCommandBuffer commandBuffer, uint32_t infoCount, progress = true; uint32_t dst_node_count = MAX2(1, DIV_ROUND_UP(bvh_states[i].node_count, 2)); - bool final_iter = dst_node_count == 1; uint32_t src_scratch_offset = bvh_states[i].scratch_offset; uint32_t dst_scratch_offset = @@ -648,7 +647,7 @@ lbvh_build_internal(VkCommandBuffer commandBuffer, uint32_t infoCount, .src_ids = pInfos[i].scratchData.deviceAddress + src_scratch_offset, .dst_ids = pInfos[i].scratchData.deviceAddress + dst_scratch_offset, .dst_offset = dst_node_offset, - .is_root_and_count = bvh_states[i].node_count | (final_iter ? 0x80000000U : 0), + .src_count = bvh_states[i].node_count, }; radv_CmdPushConstants(