Skip to content

Commit

Permalink
Optimize now iterates and converts internally.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbikker committed Nov 12, 2024
1 parent bd71219 commit de0df1e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tiny_bvh_speedtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,8 @@ int main()
// trace all rays three times to estimate average performance
// - single core version, alternative bvh layout
printf( "Optimizing BVH... " );
bvh.Convert( BVH::WALD_32BYTE, BVH::VERBOSE );
t.reset();
for (int i = 0; i < 1000000; i++) bvh.Optimize();
bvh.Convert( BVH::VERBOSE, BVH::WALD_32BYTE );
bvh.Optimize( 1000000 );
bvh.Convert( BVH::WALD_32BYTE, BVH::ALT_SOA );
printf( "done (%.2fs). New SAH=%.2f\n", t.elapsed(), bvh.SAHCost() );
for (int i = 0; i < N; i += 2) bvh.Intersect( rays[i], BVH::ALT_SOA ); // re-warm
Expand Down

0 comments on commit de0df1e

Please sign in to comment.