From 33099040a3e416bce98c3cbef1a031acc0ff78a0 Mon Sep 17 00:00:00 2001 From: Natalie Vock Date: Fri, 19 Sep 2025 20:53:17 +0200 Subject: [PATCH] vulkan/bvh: Mark instances with NAN AABBs as inactive They can never be hit, remove them from the BVH. Cc: mesa-stable Part-of: --- src/vulkan/runtime/bvh/leaf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vulkan/runtime/bvh/leaf.h b/src/vulkan/runtime/bvh/leaf.h index e3da62555ea..7f82ae9c0b0 100644 --- a/src/vulkan/runtime/bvh/leaf.h +++ b/src/vulkan/runtime/bvh/leaf.h @@ -148,6 +148,9 @@ build_instance(inout vk_aabb bounds, VOID_REF src_ptr, VOID_REF dst_ptr, uint32_ vk_aabb blas_aabb = DEREF(REF(vk_aabb)(instance.accelerationStructureReference + BVH_BOUNDS_OFFSET)); + if (any(isnan(blas_aabb.min)) || any(isnan(blas_aabb.max))) + return false; + bounds = calculate_instance_node_bounds(blas_aabb, mat3x4(transform)); #ifdef CALCULATE_FINE_INSTANCE_NODE_BOUNDS