diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-07-05 12:43:02 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-07-06 15:35:42 +0200 |
commit | b62b0e9317b82a039170e008e6c368a96d3d329c (patch) | |
tree | 1b71cff2c998dcbb18ce8dab9ce6de72bf4431d5 /src/common/Collision/BoundingIntervalHierarchy.cpp | |
parent | 0a1d2c7813fdb7bc588543262ab124cc94cc47f4 (diff) |
Core/Vmaps: Replace floatToRawIntBits/intBitsToFloat with standard bit_cast utilities
(cherry picked from commit 76a36113178cdfceeb2db40126c0ee171dc4dbcd)
Diffstat (limited to 'src/common/Collision/BoundingIntervalHierarchy.cpp')
-rw-r--r-- | src/common/Collision/BoundingIntervalHierarchy.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/Collision/BoundingIntervalHierarchy.cpp b/src/common/Collision/BoundingIntervalHierarchy.cpp index c70ac82c3aa..eeae4be71dc 100644 --- a/src/common/Collision/BoundingIntervalHierarchy.cpp +++ b/src/common/Collision/BoundingIntervalHierarchy.cpp @@ -119,8 +119,8 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat // write bvh2 clip node stats.updateInner(); tempTree[nodeIndex + 0] = (axis << 30) | (1 << 29) | nextIndex; - tempTree[nodeIndex + 1] = floatToRawIntBits(nodeL); - tempTree[nodeIndex + 2] = floatToRawIntBits(nodeR); + tempTree[nodeIndex + 1] = advstd::bit_cast<uint32>(nodeL); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(nodeR); // update nodebox and recurse nodeBox.lo[axis] = nodeL; nodeBox.hi[axis] = nodeR; @@ -185,15 +185,15 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat // write leaf node stats.updateInner(); tempTree[nodeIndex + 0] = (prevAxis << 30) | nextIndex; - tempTree[nodeIndex + 1] = floatToRawIntBits(prevClip); - tempTree[nodeIndex + 2] = floatToRawIntBits(G3D::finf()); + tempTree[nodeIndex + 1] = advstd::bit_cast<uint32>(prevClip); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(G3D::finf()); } else { // create a node with a right child // write leaf node stats.updateInner(); tempTree[nodeIndex + 0] = (prevAxis << 30) | (nextIndex - 3); - tempTree[nodeIndex + 1] = floatToRawIntBits(-G3D::finf()); - tempTree[nodeIndex + 2] = floatToRawIntBits(prevClip); + tempTree[nodeIndex + 1] = advstd::bit_cast<uint32>(-G3D::finf()); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(prevClip); } // count stats for the unused leaf depth++; @@ -224,8 +224,8 @@ void BIH::subdivide(int left, int right, std::vector<uint32> &tempTree, buildDat // write leaf node stats.updateInner(); tempTree[nodeIndex + 0] = (axis << 30) | nextIndex; - tempTree[nodeIndex + 1] = floatToRawIntBits(clipL); - tempTree[nodeIndex + 2] = floatToRawIntBits(clipR); + tempTree[nodeIndex + 1] = advstd::bit_cast<uint32>(clipL); + tempTree[nodeIndex + 2] = advstd::bit_cast<uint32>(clipR); // prepare L/R child boxes AABound gridBoxL(gridBox), gridBoxR(gridBox); AABound nodeBoxL(nodeBox), nodeBoxR(nodeBox); |