Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync main to dev #134

Merged
merged 4 commits into from
Mar 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tiny_bvh.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ THE SOFTWARE.
// These are defaults, which initialize the public members c_int and c_trav in
// BVHBase (and thus each BVH instance).
#ifndef C_INT
#define C_INT_ 1
#define C_INT 1
#endif
#ifndef C_TRAV
#define C_TRAV_ 1
#define C_TRAV 1
#endif

// SBVH: "Unsplitting"
Expand Down Expand Up @@ -663,8 +663,8 @@ class BVHBase
uint32_t usedNodes = 0; // number of nodes used for the BVH.
uint32_t triCount = 0; // number of primitives in the BVH.
uint32_t idxCount = 0; // number of primitive indices; can exceed triCount for SBVH.
float c_trav = C_TRAV_; // cost of a traversal step, used to steer SAH construction.
float c_int = C_INT_; // cost of a primitive intersection, used to steer SAH construction.
float c_trav = C_TRAV; // cost of a traversal step, used to steer SAH construction.
float c_int = C_INT; // cost of a primitive intersection, used to steer SAH construction.
bvhvec3 aabbMin, aabbMax; // bounds of the root node of the BVH.
// Custom memory allocation
void* AlignedAlloc( size_t size );
Expand Down Expand Up @@ -4223,6 +4223,7 @@ BVH8_CPU::~BVH8_CPU()
{
if (!ownBVH8) bvh8 = MBVH<8>(); // clear out pointers we don't own.
AlignedFree( bvh8Node );
AlignedFree( bvh8Leaf );
}

void BVH8_CPU::Build( const bvhvec4* vertices, const uint32_t primCount )
Expand Down Expand Up @@ -7924,4 +7925,4 @@ void BVH_Verbose::MergeSubtree( const uint32_t nodeIdx, uint32_t* newIdx, uint32
#pragma GCC diagnostic pop
#endif

#endif // TINYBVH_IMPLEMENTATION
#endif // TINYBVH_IMPLEMENTATION