radv: Clean up unused fields in BVH IR.

Reviewed-By: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18799>
This commit is contained in:
Bas Nieuwenhuizen 2022-09-29 12:29:37 +00:00 committed by Marge Bot
parent 9b1087ca7c
commit b0a385a6bd
4 changed files with 3 additions and 16 deletions

View file

@ -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

View file

@ -81,8 +81,6 @@ struct radv_accel_struct_header {
};
struct radv_ir_node {
float sah_cost;
uint32_t parent;
float aabb[2][3];
};

View file

@ -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;
}
}

View file

@ -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(