From 7cca9687b461f8b1758bf82e93640b75191d1a6a Mon Sep 17 00:00:00 2001 From: Jacco Bikker Date: Wed, 11 Dec 2024 15:15:02 +0100 Subject: [PATCH] Small patch for mac. --- tiny_bvh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiny_bvh.h b/tiny_bvh.h index 1ded20e..66bb8d3 100644 --- a/tiny_bvh.h +++ b/tiny_bvh.h @@ -4197,14 +4197,14 @@ void BVH::BuildNEON( const bvhvec4slice& vertices ) // reset node pool const uint32_t primCount = vertices.count / 3; const uint32_t spaceNeeded = primCount * 2; - if (allocatedBVHNodes < spaceNeeded) + if (allocatedNodes < spaceNeeded) { AlignedFree( bvhNode ); AlignedFree( triIdx ); AlignedFree( fragment ); triIdx = (uint32_t*)AlignedAlloc( primCount * sizeof( uint32_t ) ); bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) ); - allocatedBVHNodes = spaceNeeded; + allocatedNodes = spaceNeeded; memset( &bvhNode[1], 0, 32 ); // avoid crash in refit. fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) ); }