Skip to content

Commit

Permalink
Small bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbikker committed Nov 15, 2024
1 parent d472b84 commit c4f1b0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion tiny_bvh.h
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,6 @@ void BVH::Convert( BVHLayout from, BVHLayout to, const bool deleteOriginal )
// For now all other conversions are invalid.
assert( false );
}
rebuildable = false; // hard to guarantee safe rebuilds after a layout conversion.
}

int BVH::NodeCount( BVHLayout layout ) const
Expand Down
12 changes: 4 additions & 8 deletions tiny_bvh_speedtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,19 +382,15 @@ int main()
// trace all rays three times to estimate average performance
// - single core version, alternative bvh layout
printf( "Optimizing BVH, regular... " );
if (bvh.refittable)
t.reset();
if (!bvh.refittable)
{
printf( "Currently can't optimize SBVH.\n" );
bvh.Optimize( 1000000 ); // optimize the raw SBVH
}
else
{
t.reset();
bvh.Optimize( 1000000 );
printf( "done (%.2fs). New: %i nodes, SAH=%.2f\n", t.elapsed(), bvh.NodeCount( BVH::WALD_32BYTE ), bvh.SAHCost() );
printf( "Optimizing BVH, fullsplit... " );
t.reset();
bvh.buildFlag = BVH::FULLSPLIT;
bvh.Build( triangles, verts / 3 );
bvh.Build( triangles, verts / 3 ); // rebuild with full splitting.
bvh.Optimize( 1000000 );
bvh.MergeLeafs();
printf( "done (%.2fs). New: %i nodes, SAH=%.2f\n", t.elapsed(), bvh.NodeCount( BVH::WALD_32BYTE ), bvh.SAHCost() );
Expand Down

0 comments on commit c4f1b0d

Please sign in to comment.