Skip to content

Commit

Permalink
Small patch for mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbikker committed Dec 11, 2024
1 parent b61965d commit 7cca968
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tiny_bvh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}
Expand Down

0 comments on commit 7cca968

Please sign in to comment.