In most examples, a SmallStack with stack depth 64 is used.
If I understand the code correctly, you can run into undefined behaviour (in Release mode) or generally issues if your SmallStack is too small.
Is 64 so large that there will never be a case that it's not enough?
Or would it make sense to use GrowingStack and call reserve on the elems vector beforehand to make sure it's fast enough?
Is there any out of the box way to find the BVH depth? I couldn't find one and it doesn't seem like it's tracked during construction.
In most examples, a
SmallStackwith stack depth 64 is used.If I understand the code correctly, you can run into undefined behaviour (in Release mode) or generally issues if your
SmallStackis too small.Is 64 so large that there will never be a case that it's not enough?
Or would it make sense to use
GrowingStackand callreserveon the elems vector beforehand to make sure it's fast enough?Is there any out of the box way to find the BVH depth? I couldn't find one and it doesn't seem like it's tracked during construction.