MCPcopy Create free account
hub / github.com/cutdigital/mcut / flp2

Function flp2

source/bvh.cpp:117–125  ·  view source on GitHub ↗

compute previous power of two

Source from the content-addressed store, hash-verified

115
116// compute previous power of two
117unsigned int flp2(unsigned int x) // prev pow2
118{
119 x = x | (x >> 1);
120 x = x | (x >> 2);
121 x = x | (x >> 4);
122 x = x | (x >> 8);
123 x = x | (x >> 16);
124 return x - (x >> 1);
125}
126
127// compute size of of Oi-BVH give number of triangles
128int get_ostensibly_implicit_bvh_size(const int t)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected