|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | 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 | 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 > |
BVH_ALWAYS_INLINE Vec< T, 3 > | cross (const Vec< T, 3 > &a, const Vec< T, 3 > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE T | dot (const Vec< T, N > &a, const Vec< T, N > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | fast_mul_add (const Vec< T, N > &a, const Vec< T, N > &b, const Vec< T, N > &c) |
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | fast_mul_add (T a, T b, T c) |
| Fast multiply-add operation.
|
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE T | length (const Vec< T, N > &v) |
|
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true> |
BVH_ALWAYS_INLINE constexpr T | 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 | morton_encode (T x, T y, T z) |
| Morton-encode three unsigned integers into one.
|
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | normalize (const Vec< T, N > &v) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator* (const Vec< T, N > &a, const Vec< T, N > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator* (const Vec< T, N > &a, T b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator* (T a, const Vec< T, N > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator+ (const Vec< T, N > &a, const Vec< T, N > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator- (const Vec< T, N > &a) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator- (const Vec< T, N > &a, const Vec< T, N > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator/ (const Vec< T, N > &a, const Vec< T, N > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | operator/ (T a, const Vec< T, N > &b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | robust_max (const Vec< T, N > &a, const Vec< T, N > &b) |
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | robust_max (T a, T b) |
|
template<typename T , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | robust_min (const Vec< T, N > &a, const Vec< T, N > &b) |
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | robust_min (T a, T b) |
|
template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true> |
constexpr T | 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 , size_t N> |
BVH_ALWAYS_INLINE Vec< T, N > | safe_inverse (const Vec< T, N > &v) |
|
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true> |
BVH_ALWAYS_INLINE T | 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 | 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 | static_for (F &&f) |
| Executes the given function once for every integer in the range [Begin, End) .
|
|