|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | bvh::v2::add_ulp_magnitude (T t, unsigned ulp) |
| Adds the given number of ULPs (Units in the Last Place) to the given floating-point number.
|
|
template<typename T > |
BVH_ALWAYS_INLINE T | bvh::v2::atomic_max (std::atomic< T > &atomic, const T &value) |
| Computes the maximum between an atomic variable and a value, and returns the value previously held by the atomic variable.
|
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | bvh::v2::fast_mul_add (T a, T b, T c) |
| Fast multiply-add operation.
|
|
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true> |
BVH_ALWAYS_INLINE constexpr T | bvh::v2::make_bitmask (size_t bits) |
| Generates a bitmask with the given number of bits.
|
|
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | bvh::v2::morton_encode (T x, T y, T z) |
| Morton-encode three unsigned integers into one.
|
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | bvh::v2::robust_max (T a, T b) |
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | bvh::v2::robust_min (T a, T b) |
|
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true> |
constexpr T | bvh::v2::round_up_log2 (T i, T p=0) |
| Computes the (rounded-up) compile-time log in base-2 of an unsigned integer.
|
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | bvh::v2::safe_inverse (T x) |
| Computes the inverse of the given value, always returning a finite value.
|
|
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | bvh::v2::split_bits (T x) |
| Split an unsigned integer such that its bits are spaced by 2 zeros.
|
|
template<size_t Begin, size_t End, typename F > |
BVH_ALWAYS_INLINE void | bvh::v2::static_for (F &&f) |
| Executes the given function once for every integer in the range [Begin, End) .
|
|