Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
bvh::v2 Namespace Reference

Classes

struct  BBox
 
class  BinnedSahBuilder
 Single-threaded top-down builder that partitions primitives based on a binned approximation of the Surface Area Heuristic (SAH). More...
 
struct  Bvh
 
class  DefaultBuilder
 This builder is only a wrapper around all the other builders, which selects the best builder depending on the desired BVH quality and whether a multi-threaded build is desired. More...
 
struct  Executor
 Helper object that provides iteration and reduction over one-dimensional ranges. More...
 
struct  GrowingStack
 Growing stack that can be used for BVH traversal. More...
 
struct  IgnoreArgs
 Helper callable object that just ignores its arguments and returns nothing. More...
 
struct  Index
 Packed index data structure. More...
 
class  InputStream
 Stream of data that can be used to deserialize data structures. More...
 
class  MiniTreeBuilder
 Multi-threaded top-down builder that partitions primitives using a grid. More...
 
struct  Node
 Binary BVH node, containing its bounds and an index into its children or the primitives it contains. More...
 
struct  Octant
 
class  OutputStream
 Stream of data that can be used to serialize data structures. More...
 
struct  ParallelExecutor
 Executor that executes in parallel using the given thread pool. More...
 
struct  Ray
 
class  ReinsertionOptimizer
 
struct  SequentialExecutor
 Executor that executes serially. More...
 
struct  SmallStack
 Fixed-size stack that can be used for a BVH traversal. More...
 
class  SplitHeuristic
 
class  StdInputStream
 Stream adapter for standard library input streams. More...
 
class  StdOutputStream
 Stream adapter for standard library output streams. More...
 
class  SweepSahBuilder
 Single-threaded top-down builder that partitions primitives based on the Surface Area Heuristic (SAH). More...
 
class  ThreadPool
 
class  TopDownSahBuilder
 Base class for all SAH-based, top-down builders. More...
 
struct  UnsignedInt
 Helper type that gives an unsigned integer type with the given number of bits. More...
 
struct  UnsignedInt< 16 >
 
struct  UnsignedInt< 32 >
 
struct  UnsignedInt< 64 >
 
struct  UnsignedInt< 8 >
 
struct  Vec
 

Typedefs

template<size_t Bits>
using UnsignedIntType = typename UnsignedInt< Bits >::Type
 

Functions

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINEadd_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_INLINEatomic_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_INLINEdot (const Vec< T, N > &a, const Vec< T, N > &b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Nfast_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_INLINEfast_mul_add (T a, T b, T c)
 Fast multiply-add operation.
 
template<typename T , size_t N>
BVH_ALWAYS_INLINElength (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_INLINEmorton_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, Nnormalize (const Vec< T, N > &v)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator* (const Vec< T, N > &a, const Vec< T, N > &b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator* (const Vec< T, N > &a, T b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator* (T a, const Vec< T, N > &b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator+ (const Vec< T, N > &a, const Vec< T, N > &b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator- (const Vec< T, N > &a)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator- (const Vec< T, N > &a, const Vec< T, N > &b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator/ (const Vec< T, N > &a, const Vec< T, N > &b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Noperator/ (T a, const Vec< T, N > &b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Nrobust_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_INLINErobust_max (T a, T b)
 
template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, Nrobust_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_INLINErobust_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, Nsafe_inverse (const Vec< T, N > &v)
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINEsafe_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_INLINEsplit_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).
 

Typedef Documentation

◆ UnsignedIntType

template<size_t Bits>
using bvh::v2::UnsignedIntType = typedef typename UnsignedInt<Bits>::Type

Definition at line 25 of file utils.h.

Function Documentation

◆ add_ulp_magnitude()

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,
unsigned  ulp 
)

Adds the given number of ULPs (Units in the Last Place) to the given floating-point number.

Definition at line 47 of file utils.h.

◆ atomic_max()

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.

Definition at line 125 of file utils.h.

◆ cross()

template<typename T >
BVH_ALWAYS_INLINE Vec< T, 3 > bvh::v2::cross ( const Vec< T, 3 > &  a,
const Vec< T, 3 > &  b 
)

Definition at line 104 of file vec.h.

◆ dot()

template<typename T , size_t N>
BVH_ALWAYS_INLINE T bvh::v2::dot ( const Vec< T, N > &  a,
const Vec< T, N > &  b 
)

Definition at line 98 of file vec.h.

◆ fast_mul_add() [1/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::fast_mul_add ( const Vec< T, N > &  a,
const Vec< T, N > &  b,
const Vec< T, N > &  c 
)

Definition at line 112 of file vec.h.

◆ fast_mul_add() [2/2]

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINE T bvh::v2::fast_mul_add ( a,
b,
c 
)

Fast multiply-add operation.

Should translate into an FMA for architectures that support it. On architectures which do not support FMA in hardware, or on which FMA is slow, this defaults to a regular multiplication followed by an addition.

Definition at line 74 of file utils.h.

◆ length()

template<typename T , size_t N>
BVH_ALWAYS_INLINE T bvh::v2::length ( const Vec< T, N > &  v)

Definition at line 122 of file vec.h.

◆ make_bitmask()

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)
constexpr

Generates a bitmask with the given number of bits.

Definition at line 35 of file utils.h.

◆ morton_encode()

template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true>
BVH_ALWAYS_INLINE T bvh::v2::morton_encode ( x,
y,
z 
)

Morton-encode three unsigned integers into one.

Definition at line 118 of file utils.h.

◆ normalize()

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::normalize ( const Vec< T, N > &  v)

Definition at line 127 of file vec.h.

◆ operator*() [1/3]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator* ( const Vec< T, N > &  a,
const Vec< T, N > &  b 
)

Definition at line 63 of file vec.h.

◆ operator*() [2/3]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator* ( const Vec< T, N > &  a,
b 
)

Definition at line 73 of file vec.h.

◆ operator*() [3/3]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator* ( a,
const Vec< T, N > &  b 
)

Definition at line 78 of file vec.h.

◆ operator+()

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator+ ( const Vec< T, N > &  a,
const Vec< T, N > &  b 
)

Definition at line 48 of file vec.h.

◆ operator-() [1/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator- ( const Vec< T, N > &  a)

Definition at line 58 of file vec.h.

◆ operator-() [2/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator- ( const Vec< T, N > &  a,
const Vec< T, N > &  b 
)

Definition at line 53 of file vec.h.

◆ operator/() [1/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator/ ( const Vec< T, N > &  a,
const Vec< T, N > &  b 
)

Definition at line 68 of file vec.h.

◆ operator/() [2/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::operator/ ( a,
const Vec< T, N > &  b 
)

Definition at line 83 of file vec.h.

◆ robust_max() [1/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::robust_max ( const Vec< T, N > &  a,
const Vec< T, N > &  b 
)

Definition at line 93 of file vec.h.

◆ robust_max() [2/2]

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINE T bvh::v2::robust_max ( a,
b 
)

Definition at line 43 of file utils.h.

◆ robust_min() [1/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::robust_min ( const Vec< T, N > &  a,
const Vec< T, N > &  b 
)

Definition at line 88 of file vec.h.

◆ robust_min() [2/2]

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINE T bvh::v2::robust_min ( a,
b 
)

Definition at line 41 of file utils.h.

◆ round_up_log2()

template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true>
constexpr T bvh::v2::round_up_log2 ( i,
p = 0 
)
inlineconstexpr

Computes the (rounded-up) compile-time log in base-2 of an unsigned integer.

Definition at line 97 of file utils.h.

◆ safe_inverse() [1/2]

template<typename T , size_t N>
BVH_ALWAYS_INLINE Vec< T, N > bvh::v2::safe_inverse ( const Vec< T, N > &  v)

Definition at line 117 of file vec.h.

◆ safe_inverse() [2/2]

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
BVH_ALWAYS_INLINE T bvh::v2::safe_inverse ( x)

Computes the inverse of the given value, always returning a finite value.

Definition at line 59 of file utils.h.

◆ split_bits()

template<typename T , std::enable_if_t< std::is_unsigned_v< T >, bool > = true>
BVH_ALWAYS_INLINE T bvh::v2::split_bits ( x)

Split an unsigned integer such that its bits are spaced by 2 zeros.

For instance, split_bits(0b00110010) = 0b000000001001000000001000.

Definition at line 104 of file utils.h.

◆ static_for()

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).

Definition at line 88 of file utils.h.