From 63daa4e73139c00d778204641322c441789dfc16 Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sun, 18 Jan 2026 20:58:43 +0100 Subject: [PATCH] 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 Part-of: --- src/vulkan/runtime/vk_acceleration_structure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vulkan/runtime/vk_acceleration_structure.c b/src/vulkan/runtime/vk_acceleration_structure.c index 597d702f26e..8df475e9ffe 100644 --- a/src/vulkan/runtime/vk_acceleration_structure.c +++ b/src/vulkan/runtime/vk_acceleration_structure.c @@ -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);