Eliminating some differences from the cubiquity-version branch.

This commit is contained in:
Daviw Williams
2014-02-25 16:51:26 +01:00
parent 0e8973e722
commit 2458f94feb
4 changed files with 19 additions and 2 deletions

View File

@ -56,4 +56,17 @@ namespace PolyVox
else
return ((uInput & (uInput-1)) == 0);
}
// http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
uint32_t upperPowerOfTwo(uint32_t v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
return v;
}
}