mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 09:20:13 +01:00
radv/rra: Count box16 nodes properly
Otherwise rra won't allocate memory when loading the capture.
This commit is contained in:
parent
430e435d32
commit
9a4e00a925
3 changed files with 12 additions and 7 deletions
|
|
@ -198,7 +198,8 @@ rra_fill_accel_struct_header_common(const struct radv_physical_device *pdev, str
|
|||
/* TODO: calculate active primitives */
|
||||
.active_primitive_count = primitive_count,
|
||||
.geometry_description_count = header->geometry_count,
|
||||
.interior_fp32_node_count = bvh_info->internal_nodes_size / sizeof(struct radv_bvh_box32_node),
|
||||
.interior_fp32_node_count = bvh_info->box32_count,
|
||||
.interior_fp16_node_count = bvh_info->box16_count,
|
||||
.leaf_node_count = primitive_count,
|
||||
.rt_driver_interface_version = 8 << 16,
|
||||
.rt_ip_version = pdev->info.rt_ip_version,
|
||||
|
|
|
|||
|
|
@ -289,6 +289,8 @@ struct rra_bvh_info {
|
|||
uint32_t leaf_nodes_size;
|
||||
uint32_t internal_nodes_size;
|
||||
uint32_t instance_sideband_data_size;
|
||||
uint32_t box32_count;
|
||||
uint32_t box16_count;
|
||||
struct rra_geometry_info *geometry_infos;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -177,9 +177,11 @@ rra_gather_bvh_info_gfx10_3(const uint8_t *bvh, uint32_t node_id, struct rra_bvh
|
|||
switch (node_type) {
|
||||
case radv_bvh_node_box16:
|
||||
dst->internal_nodes_size += sizeof(struct rra_box16_node);
|
||||
dst->box16_count++;
|
||||
break;
|
||||
case radv_bvh_node_box32:
|
||||
dst->internal_nodes_size += sizeof(struct rra_box32_node);
|
||||
dst->box32_count++;
|
||||
break;
|
||||
case radv_bvh_node_instance:
|
||||
dst->leaf_nodes_size += sizeof(struct rra_instance_node);
|
||||
|
|
@ -283,15 +285,15 @@ rra_transcode_box16_node(struct rra_transcoding_context *ctx, const struct radv_
|
|||
vk_aabb bounds = {
|
||||
.min =
|
||||
{
|
||||
_mesa_half_to_float(src->coords[i][0][0]),
|
||||
_mesa_half_to_float(src->coords[i][0][1]),
|
||||
_mesa_half_to_float(src->coords[i][0][2]),
|
||||
_mesa_half_to_float(src->coords[i].min_x),
|
||||
_mesa_half_to_float(src->coords[i].min_y),
|
||||
_mesa_half_to_float(src->coords[i].min_z),
|
||||
},
|
||||
.max =
|
||||
{
|
||||
_mesa_half_to_float(src->coords[i][1][0]),
|
||||
_mesa_half_to_float(src->coords[i][1][1]),
|
||||
_mesa_half_to_float(src->coords[i][1][2]),
|
||||
_mesa_half_to_float(src->coords[i].max_x),
|
||||
_mesa_half_to_float(src->coords[i].max_y),
|
||||
_mesa_half_to_float(src->coords[i].max_z),
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue