vulkan: Request less scratch space for lbvh

It is fine if prior passes write to the region so the memory can be
reused.

Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39752>
This commit is contained in:
Konstantin Seurer 2026-01-18 20:58:43 +01:00 committed by Marge Bot
parent 4ab113b7eb
commit 63daa4e731

View file

@ -229,11 +229,11 @@ vk_acceleration_structure_build_state_init(struct vk_acceleration_structure_buil
/* Internal sorting data is not needed when PLOC/LBVH are invoked,
* save space by aliasing them */
state->scratch.ploc_prefix_sum_partition_offset = offset;
offset += MAX2(requirements.internal_size, ploc_scratch_space);
state->scratch.lbvh_node_offset = offset;
offset += MAX3(requirements.internal_size, ploc_scratch_space, lbvh_node_space);
state->scratch.hploc_ranges_offset = offset;
offset += MAX2(hploc_scratch_space, lbvh_node_space);
offset += hploc_scratch_space;
/* Make sure encode scratch space does not overlap the BVH. */
offset = MAX2(offset, encode_scratch_end);