Skip to content

Commit

Permalink
Fix Mac build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbikker committed Nov 18, 2024
1 parent 32a8972 commit f33708d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tiny_bvh.h
Original file line number Diff line number Diff line change
Expand Up @@ -3177,15 +3177,15 @@ void BVH::BuildNEON( const bvhvec4* vertices, const unsigned primCount )
const unsigned spaceNeeded = primCount * 2;
if (allocatedBVHNodes < spaceNeeded)
{
Free( bvhNode );
Free( triIdx );
Free( fragment );
AlignedFree( bvhNode );
AlignedFree( triIdx );
AlignedFree( fragment );
verts = (bvhvec4*)vertices;
triIdx = (unsigned*)Alloc( primCount * sizeof( unsigned ) );
bvhNode = (BVHNode*)Alloc( spaceNeeded * sizeof( BVHNode ) );
triIdx = (unsigned*)AlignedAlloc( primCount * sizeof( unsigned ) );
bvhNode = (BVHNode*)AlignedAlloc( spaceNeeded * sizeof( BVHNode ) );
allocatedBVHNodes = spaceNeeded;
memset( &bvhNode[1], 0, 32 ); // avoid crash in refit.
fragment = (Fragment*)Alloc( primCount * sizeof( Fragment ) );
fragment = (Fragment*)AlignedAlloc( primCount * sizeof( Fragment ) );
}
else assert( rebuildable == true );
triCount = idxCount = primCount;
Expand Down

0 comments on commit f33708d

Please sign in to comment.