Blender  V3.3
Macros | Functions
util/math.h File Reference
#include <cmath>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include "util/types.h"
#include "util/math_int2.h"
#include "util/math_int3.h"
#include "util/math_int4.h"
#include "util/math_float2.h"
#include "util/math_float3.h"
#include "util/math_float4.h"
#include "util/math_float8.h"
#include "util/rect.h"

Go to the source code of this file.

Macros

#define M_PI_F   (3.1415926535897932f) /* pi */
 
#define M_PI_2_F   (1.5707963267948966f) /* pi/2 */
 
#define M_PI_4_F   (0.7853981633974830f) /* pi/4 */
 
#define M_1_PI_F   (0.3183098861837067f) /* 1/pi */
 
#define M_2_PI_F   (0.6366197723675813f) /* 2/pi */
 
#define M_1_2PI_F   (0.1591549430918953f) /* 1/(2*pi) */
 
#define M_SQRT_PI_8_F   (0.6266570686577501f) /* sqrt(pi/8) */
 
#define M_LN_2PI_F   (1.8378770664093454f) /* ln(2*pi) */
 
#define M_2PI_F   (6.2831853071795864f) /* 2*pi */
 
#define M_4PI_F   (12.566370614359172f) /* 4*pi */
 
#define M_SQRT2_F   (1.4142135623730950f) /* sqrt(2) */
 
#define M_SQRT3_F   (1.7320508075688772f) /* sqrt(3) */
 
#define M_LN2_F   (0.6931471805599453f) /* ln(2) */
 
#define M_LN10_F   (2.3025850929940457f) /* ln(10) */
 
#define __has_builtin(v)   0
 

Functions

ccl_device_inline int abs (int x)
 
ccl_device_inline int max (int a, int b)
 
ccl_device_inline int min (int a, int b)
 
ccl_device_inline uint32_t max (uint32_t a, uint32_t b)
 
ccl_device_inline uint32_t min (uint32_t a, uint32_t b)
 
ccl_device_inline uint64_t max (uint64_t a, uint64_t b)
 
ccl_device_inline uint64_t min (uint64_t a, uint64_t b)
 
template<class T >
ccl_device_inline std::enable_if_t< std::is_same_v< T, size_t >, Tmax (T a, T b)
 
template<class T >
ccl_device_inline std::enable_if_t< std::is_same_v< T, size_t >, Tmin (T a, T b)
 
ccl_device_inline float max (float a, float b)
 
ccl_device_inline float min (float a, float b)
 
ccl_device_inline double max (double a, double b)
 
ccl_device_inline double min (double a, double b)
 
template<typename T >
ccl_device_inline T min4 (const T &a, const T &b, const T &c, const T &d)
 
template<typename T >
ccl_device_inline T max4 (const T &a, const T &b, const T &c, const T &d)
 
ccl_device_inline float min4 (float a, float b, float c, float d)
 
ccl_device_inline float max4 (float a, float b, float c, float d)
 
ccl_device_inline int as_int (uint i)
 
ccl_device_inline uint as_uint (int i)
 
ccl_device_inline uint as_uint (float f)
 
ccl_device_inline int __float_as_int (float f)
 
ccl_device_inline float __int_as_float (int i)
 
ccl_device_inline uint __float_as_uint (float f)
 
ccl_device_inline float __uint_as_float (uint i)
 
ccl_device_inline int4 __float4_as_int4 (float4 f)
 
ccl_device_inline float4 __int4_as_float4 (int4 i)
 
template<typename T >
ccl_device_inline uint pointer_pack_to_uint_0 (T *ptr)
 
template<typename T >
ccl_device_inline uint pointer_pack_to_uint_1 (T *ptr)
 
template<typename T >
ccl_device_inline Tpointer_unpack_from_uint (const uint a, const uint b)
 
ccl_device_inline uint uint16_pack_to_uint (const uint a, const uint b)
 
ccl_device_inline uint uint16_unpack_from_uint_0 (const uint i)
 
ccl_device_inline uint uint16_unpack_from_uint_1 (const uint i)
 
ccl_device_inline bool isnan_safe (float f)
 
ccl_device_inline bool isfinite_safe (float f)
 
ccl_device_inline float ensure_finite (float v)
 
ccl_device_inline int clamp (int a, int mn, int mx)
 
ccl_device_inline float clamp (float a, float mn, float mx)
 
ccl_device_inline float mix (float a, float b, float t)
 
ccl_device_inline float smoothstep (float edge0, float edge1, float x)
 
ccl_device_inline float saturatef (float a)
 
ccl_device_inline int float_to_int (float f)
 
ccl_device_inline int floor_to_int (float f)
 
ccl_device_inline float floorfrac (float x, ccl_private int *i)
 
ccl_device_inline int ceil_to_int (float f)
 
ccl_device_inline float fractf (float x)
 
ccl_device_inline float wrapf (float value, float max, float min)
 
ccl_device_inline float pingpongf (float a, float b)
 
ccl_device_inline float smoothminf (float a, float b, float k)
 
ccl_device_inline float signf (float f)
 
ccl_device_inline float nonzerof (float f, float eps)
 
ccl_device_inline float compatible_signf (float f)
 
ccl_device_inline float smoothstepf (float f)
 
ccl_device_inline int mod (int x, int m)
 
ccl_device_inline float3 float2_to_float3 (const float2 a)
 
ccl_device_inline float3 float4_to_float3 (const float4 a)
 
ccl_device_inline float4 float3_to_float4 (const float3 a)
 
ccl_device_inline float4 float3_to_float4 (const float3 a, const float w)
 
ccl_device_inline float inverse_lerp (float a, float b, float x)
 
ccl_device_inline float cubic_interp (float a, float b, float c, float d, float x)
 
template<class A , class B >
CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN A lerp (const A &a, const A &b, const B &t)
 
ccl_device_inline float triangle_area (ccl_private const float3 &v1, ccl_private const float3 &v2, ccl_private const float3 &v3)
 
ccl_device_inline void make_orthonormals (const float3 N, ccl_private float3 *a, ccl_private float3 *b)
 
ccl_device_inline float3 safe_invert_color (float3 a)
 
ccl_device_inline float3 safe_divide_color (float3 a, float3 b)
 
ccl_device_inline float3 safe_divide_even_color (float3 a, float3 b)
 
ccl_device_inline float3 rotate_around_axis (float3 p, float3 axis, float angle)
 
ccl_device_inline float safe_sqrtf (float f)
 
ccl_device_inline float inversesqrtf (float f)
 
ccl_device float safe_asinf (float a)
 
ccl_device float safe_acosf (float a)
 
ccl_device float compatible_powf (float x, float y)
 
ccl_device float safe_powf (float a, float b)
 
ccl_device float safe_divide (float a, float b)
 
ccl_device float safe_logf (float a, float b)
 
ccl_device float safe_modulo (float a, float b)
 
ccl_device_inline float sqr (float a)
 
ccl_device_inline float pow20 (float a)
 
ccl_device_inline float pow22 (float a)
 
ccl_device_inline float beta (float x, float y)
 
ccl_device_inline float xor_signmask (float x, int y)
 
ccl_device float bits_to_01 (uint bits)
 
ccl_device_inline uint popcount (uint x)
 
ccl_device_inline uint count_leading_zeros (uint x)
 
ccl_device_inline uint count_trailing_zeros (uint x)
 
ccl_device_inline uint find_first_set (uint x)
 
ccl_device_inline float2 map_to_tube (const float3 co)
 
ccl_device_inline float2 map_to_sphere (const float3 co)
 
ccl_device_inline bool compare_floats (float a, float b, float abs_diff, int ulp_diff)
 
ccl_device_inline float precise_angle (float3 a, float3 b)
 
ccl_device_inline uint next_power_of_two (uint x)
 
ccl_device_inline uint prev_power_of_two (uint x)
 
ccl_device_inline uint32_t reverse_integer_bits (uint32_t x)
 

Macro Definition Documentation

◆ __has_builtin

#define __has_builtin (   v)    0

Definition at line 945 of file util/math.h.

◆ M_1_2PI_F

#define M_1_2PI_F   (0.1591549430918953f) /* 1/(2*pi) */

Definition at line 49 of file util/math.h.

◆ M_1_PI_F

#define M_1_PI_F   (0.3183098861837067f) /* 1/pi */

Definition at line 43 of file util/math.h.

◆ M_2_PI_F

#define M_2_PI_F   (0.6366197723675813f) /* 2/pi */

Definition at line 46 of file util/math.h.

◆ M_2PI_F

#define M_2PI_F   (6.2831853071795864f) /* 2*pi */

Definition at line 60 of file util/math.h.

◆ M_4PI_F

#define M_4PI_F   (12.566370614359172f) /* 4*pi */

Definition at line 63 of file util/math.h.

◆ M_LN10_F

#define M_LN10_F   (2.3025850929940457f) /* ln(10) */

Definition at line 77 of file util/math.h.

◆ M_LN2_F

#define M_LN2_F   (0.6931471805599453f) /* ln(2) */

Definition at line 74 of file util/math.h.

◆ M_LN_2PI_F

#define M_LN_2PI_F   (1.8378770664093454f) /* ln(2*pi) */

Definition at line 55 of file util/math.h.

◆ M_PI_2_F

#define M_PI_2_F   (1.5707963267948966f) /* pi/2 */

Definition at line 37 of file util/math.h.

◆ M_PI_4_F

#define M_PI_4_F   (0.7853981633974830f) /* pi/4 */

Definition at line 40 of file util/math.h.

◆ M_PI_F

#define M_PI_F   (3.1415926535897932f) /* pi */

Definition at line 34 of file util/math.h.

◆ M_SQRT2_F

#define M_SQRT2_F   (1.4142135623730950f) /* sqrt(2) */

Definition at line 68 of file util/math.h.

◆ M_SQRT3_F

#define M_SQRT3_F   (1.7320508075688772f) /* sqrt(3) */

Definition at line 71 of file util/math.h.

◆ M_SQRT_PI_8_F

#define M_SQRT_PI_8_F   (0.6266570686577501f) /* sqrt(pi/8) */

Definition at line 52 of file util/math.h.

Function Documentation

◆ __float4_as_int4()

ccl_device_inline int4 __float4_as_int4 ( float4  f)

Definition at line 284 of file util/math.h.

References __float_as_int(), and make_int4.

Referenced by fast_exp2f4().

◆ __float_as_int()

ccl_device_inline int __float_as_int ( float  f)

◆ __float_as_uint()

ccl_device_inline uint __float_as_uint ( float  f)

◆ __int4_as_float4()

ccl_device_inline float4 __int4_as_float4 ( int4  i)

Definition at line 294 of file util/math.h.

References __int_as_float(), make_float4, int4::w, int4::x, int4::y, and int4::z.

Referenced by fast_exp2f4().

◆ __int_as_float()

ccl_device_inline float __int_as_float ( int  i)

◆ __uint_as_float()

ccl_device_inline float __uint_as_float ( uint  i)

◆ abs()

ccl_device_inline int abs ( int  x)

Definition at line 108 of file util/math.h.

References x.

Referenced by compare_floats().

◆ as_int()

ccl_device_inline int as_int ( uint  i)

Definition at line 212 of file util/math.h.

Referenced by BM_mesh_intersect_edges().

◆ as_uint() [1/2]

ccl_device_inline uint as_uint ( float  f)

Definition at line 232 of file util/math.h.

◆ as_uint() [2/2]

ccl_device_inline uint as_uint ( int  i)

Definition at line 222 of file util/math.h.

Referenced by emit_attribute_map_entry().

◆ beta()

ccl_device_inline float beta ( float  x,
float  y 
)

◆ bits_to_01()

ccl_device float bits_to_01 ( uint  bits)

Definition at line 785 of file util/math.h.

References float().

◆ ceil_to_int()

ccl_device_inline int ceil_to_int ( float  f)

Definition at line 427 of file util/math.h.

References ceilf, and float_to_int().

◆ clamp() [1/2]

ccl_device_inline float clamp ( float  a,
float  mn,
float  mx 
)

Definition at line 372 of file util/math.h.

References Freestyle::a, max(), and min().

◆ clamp() [2/2]

ccl_device_inline int clamp ( int  a,
int  mn,
int  mx 
)

Definition at line 367 of file util/math.h.

References Freestyle::a, max(), and min().

Referenced by safe_acosf(), safe_asinf(), and saturatef().

◆ compare_floats()

ccl_device_inline bool compare_floats ( float  a,
float  b,
float  abs_diff,
int  ulp_diff 
)

Definition at line 909 of file util/math.h.

References __float_as_int(), Freestyle::a, abs(), usdtokens::b(), and fabsf.

◆ compatible_powf()

ccl_device float compatible_powf ( float  x,
float  y 
)

Definition at line 701 of file util/math.h.

References fmodf, powf, x, and y.

Referenced by safe_powf().

◆ compatible_signf()

ccl_device_inline float compatible_signf ( float  f)

Definition at line 474 of file util/math.h.

References signf().

◆ count_leading_zeros()

ccl_device_inline uint count_leading_zeros ( uint  x)

Definition at line 813 of file util/math.h.

References x.

Referenced by find_first_set(), next_power_of_two(), and prev_power_of_two().

◆ count_trailing_zeros()

ccl_device_inline uint count_trailing_zeros ( uint  x)

Definition at line 833 of file util/math.h.

References x.

◆ cubic_interp()

ccl_device_inline float cubic_interp ( float  a,
float  b,
float  c,
float  d,
float  x 
)

Definition at line 521 of file util/math.h.

References Freestyle::a, usdtokens::b(), Freestyle::c, and x.

Referenced by interpolate_ies_vertical(), and kernel_ies_interp().

◆ ensure_finite()

ccl_device_inline float ensure_finite ( float  v)

◆ find_first_set()

ccl_device_inline uint find_first_set ( uint  x)

Definition at line 853 of file util/math.h.

References count_leading_zeros(), and x.

◆ float2_to_float3()

ccl_device_inline float3 float2_to_float3 ( const float2  a)

Definition at line 495 of file util/math.h.

References Freestyle::a, and make_float3.

Referenced by primitive_motion_vector().

◆ float3_to_float4() [1/2]

ccl_device_inline float4 float3_to_float4 ( const float3  a)

◆ float3_to_float4() [2/2]

ccl_device_inline float4 float3_to_float4 ( const float3  a,
const float  w 
)

Definition at line 510 of file util/math.h.

References Freestyle::a, make_float4, and w().

◆ float4_to_float3()

ccl_device_inline float3 float4_to_float3 ( const float4  a)

◆ float_to_int()

ccl_device_inline int float_to_int ( float  f)

◆ floor_to_int()

ccl_device_inline int floor_to_int ( float  f)

Definition at line 415 of file util/math.h.

References float_to_int(), and floorf.

Referenced by HdCyclesDelegate::GetRenderStats(), and svm_brick().

◆ floorfrac()

ccl_device_inline float floorfrac ( float  x,
ccl_private int *  i 
)

Definition at line 420 of file util/math.h.

References float_to_int(), floorf, and x.

Referenced by perlin_1d(), perlin_2d(), perlin_3d(), and perlin_4d().

◆ fractf()

ccl_device_inline float fractf ( float  x)

Definition at line 432 of file util/math.h.

References floorf, and x.

Referenced by pingpongf().

◆ inverse_lerp()

ccl_device_inline float inverse_lerp ( float  a,
float  b,
float  x 
)

Definition at line 515 of file util/math.h.

References Freestyle::a, usdtokens::b(), and x.

Referenced by kernel_ies_interp().

◆ inversesqrtf()

ccl_device_inline float inversesqrtf ( float  f)

Definition at line 682 of file util/math.h.

References sqrtf.

Referenced by svm_math().

◆ isfinite_safe()

ccl_device_inline bool isfinite_safe ( float  f)

◆ isnan_safe()

ccl_device_inline bool isnan_safe ( float  f)

Definition at line 347 of file util/math.h.

References __float_as_uint(), and x.

◆ lerp()

template<class A , class B >
CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN A lerp ( const A a,
const A b,
const B t 
)

Definition at line 548 of file util/math.h.

References A, Freestyle::a, B, usdtokens::b(), and t.

◆ make_orthonormals()

ccl_device_inline void make_orthonormals ( const float3  N,
ccl_private float3 a,
ccl_private float3 b 
)

◆ map_to_sphere()

ccl_device_inline float2 map_to_sphere ( const float3  co)

Definition at line 883 of file util/math.h.

References atan2f, l, len, M_PI_F, make_float2, safe_acosf(), UNLIKELY, v, float3::x, float3::y, and float3::z.

◆ map_to_tube()

ccl_device_inline float2 map_to_tube ( const float3  co)

Definition at line 869 of file util/math.h.

References atan2f, len, M_PI_F, make_float2, sqrtf, v, float3::x, float3::y, and float3::z.

◆ max() [1/6]

ccl_device_inline double max ( double  a,
double  b 
)

Definition at line 172 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ max() [2/6]

ccl_device_inline float max ( float  a,
float  b 
)

Definition at line 162 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ max() [3/6]

ccl_device_inline int max ( int  a,
int  b 
)

Definition at line 113 of file util/math.h.

References Freestyle::a, and usdtokens::b().

Referenced by clamp(), max4(), safe_sqrtf(), and wrapf().

◆ max() [4/6]

template<class T >
ccl_device_inline std::enable_if_t<std::is_same_v<T, size_t>, T> max ( T  a,
T  b 
)

Definition at line 151 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ max() [5/6]

Definition at line 123 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ max() [6/6]

Definition at line 133 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ max4() [1/2]

template<typename T >
ccl_device_inline T max4 ( const T a,
const T b,
const T c,
const T d 
)

◆ max4() [2/2]

ccl_device_inline float max4 ( float  a,
float  b,
float  c,
float  d 
)

Definition at line 204 of file util/math.h.

References Freestyle::a, usdtokens::b(), Freestyle::c, and max().

◆ min() [1/6]

ccl_device_inline double min ( double  a,
double  b 
)

Definition at line 177 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ min() [2/6]

ccl_device_inline float min ( float  a,
float  b 
)

Definition at line 167 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ min() [3/6]

ccl_device_inline int min ( int  a,
int  b 
)

Definition at line 118 of file util/math.h.

References Freestyle::a, and usdtokens::b().

Referenced by clamp(), min4(), and wrapf().

◆ min() [4/6]

template<class T >
ccl_device_inline std::enable_if_t<std::is_same_v<T, size_t>, T> min ( T  a,
T  b 
)

Definition at line 157 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ min() [5/6]

Definition at line 128 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ min() [6/6]

Definition at line 138 of file util/math.h.

References Freestyle::a, and usdtokens::b().

◆ min4() [1/2]

template<typename T >
ccl_device_inline T min4 ( const T a,
const T b,
const T c,
const T d 
)

◆ min4() [2/2]

ccl_device_inline float min4 ( float  a,
float  b,
float  c,
float  d 
)

Definition at line 199 of file util/math.h.

References Freestyle::a, usdtokens::b(), Freestyle::c, and min().

◆ mix()

ccl_device_inline float mix ( float  a,
float  b,
float  t 
)

Definition at line 377 of file util/math.h.

References Freestyle::a, usdtokens::b(), and t.

◆ mod()

ccl_device_inline int mod ( int  x,
int  m 
)

◆ next_power_of_two()

ccl_device_inline uint next_power_of_two ( uint  x)

Definition at line 933 of file util/math.h.

References count_leading_zeros(), and x.

Referenced by round_num_samples_to_power_of_2(), round_up_to_power_of_two(), and TEST().

◆ nonzerof()

ccl_device_inline float nonzerof ( float  f,
float  eps 
)

Definition at line 465 of file util/math.h.

References eps, fabsf, and signf().

◆ pingpongf()

ccl_device_inline float pingpongf ( float  a,
float  b 
)

Definition at line 444 of file util/math.h.

References Freestyle::a, usdtokens::b(), fabsf, and fractf().

◆ pointer_pack_to_uint_0()

template<typename T >
ccl_device_inline uint pointer_pack_to_uint_0 ( T ptr)

Definition at line 316 of file util/math.h.

References ptr.

◆ pointer_pack_to_uint_1()

template<typename T >
ccl_device_inline uint pointer_pack_to_uint_1 ( T ptr)

Definition at line 321 of file util/math.h.

References ptr.

◆ pointer_unpack_from_uint()

template<typename T >
ccl_device_inline T* pointer_unpack_from_uint ( const uint  a,
const uint  b 
)

Definition at line 326 of file util/math.h.

References Freestyle::a, usdtokens::b(), and T.

◆ popcount()

ccl_device_inline uint popcount ( uint  x)

Definition at line 794 of file util/math.h.

References x.

Referenced by gpu_parallel_active_index_array_impl(), if(), and sample_is_even().

◆ pow20()

Definition at line 751 of file util/math.h.

References Freestyle::a, and sqr().

◆ pow22()

Definition at line 756 of file util/math.h.

References Freestyle::a, and sqr().

◆ precise_angle()

ccl_device_inline float precise_angle ( float3  a,
float3  b 
)

Definition at line 927 of file util/math.h.

References Freestyle::a, atan2f, usdtokens::b(), and len.

Referenced by sky_radiance_nishita().

◆ prev_power_of_two()

ccl_device_inline uint prev_power_of_two ( uint  x)

Definition at line 939 of file util/math.h.

References count_leading_zeros(), and x.

Referenced by round_down_to_power_of_two(), and TEST().

◆ reverse_integer_bits()

ccl_device_inline uint32_t reverse_integer_bits ( uint32_t  x)

Definition at line 949 of file util/math.h.

References x.

Referenced by nested_uniform_scramble(), and TEST().

◆ rotate_around_axis()

ccl_device_inline float3 rotate_around_axis ( float3  p,
float3  axis,
float  angle 
)

Definition at line 654 of file util/math.h.

References angle(), cosf, r, sinf, float3::x, float3::y, and float3::z.

Referenced by svm_node_closure_bsdf(), and svm_node_vector_rotate().

◆ safe_acosf()

ccl_device float safe_acosf ( float  a)

◆ safe_asinf()

ccl_device float safe_asinf ( float  a)

◆ safe_divide()

ccl_device float safe_divide ( float  a,
float  b 
)

Definition at line 728 of file util/math.h.

References Freestyle::a, and usdtokens::b().

Referenced by safe_logf().

◆ safe_divide_color()

ccl_device_inline float3 safe_divide_color ( float3  a,
float3  b 
)

Definition at line 605 of file util/math.h.

References Freestyle::a, usdtokens::b(), make_float3, x, y, and z.

Referenced by hair_attenuation(), and subsurface_random_walk_coefficients().

◆ safe_divide_even_color()

ccl_device_inline float3 safe_divide_even_color ( float3  a,
float3  b 
)

Definition at line 616 of file util/math.h.

References Freestyle::a, usdtokens::b(), if(), make_float3, x, y, and z.

Referenced by film_get_pass_pixel_light_path().

◆ safe_invert_color()

ccl_device_inline float3 safe_invert_color ( float3  a)

Definition at line 594 of file util/math.h.

References Freestyle::a, make_float3, x, y, and z.

◆ safe_logf()

ccl_device float safe_logf ( float  a,
float  b 
)

◆ safe_modulo()

ccl_device float safe_modulo ( float  a,
float  b 
)

Definition at line 741 of file util/math.h.

References Freestyle::a, usdtokens::b(), and fmodf.

◆ safe_powf()

ccl_device float safe_powf ( float  a,
float  b 
)

◆ safe_sqrtf()

ccl_device_inline float safe_sqrtf ( float  f)

◆ saturatef()

ccl_device_inline float saturatef ( float  a)

◆ signf()

◆ smoothminf()

ccl_device_inline float smoothminf ( float  a,
float  b,
float  k 
)

Definition at line 449 of file util/math.h.

References Freestyle::a, usdtokens::b(), fabsf, fmaxf, and fminf.

◆ smoothstep()

ccl_device_inline float smoothstep ( float  edge0,
float  edge1,
float  x 
)

Definition at line 382 of file util/math.h.

References result, t, and x.

◆ smoothstepf()

ccl_device_inline float smoothstepf ( float  f)

Definition at line 484 of file util/math.h.

Referenced by spot_light_attenuation(), and svm_brick().

◆ sqr()

◆ triangle_area()

ccl_device_inline float triangle_area ( ccl_private const float3 v1,
ccl_private const float3 v2,
ccl_private const float3 v3 
)

◆ uint16_pack_to_uint()

ccl_device_inline uint uint16_pack_to_uint ( const uint  a,
const uint  b 
)

Definition at line 331 of file util/math.h.

References Freestyle::a, and usdtokens::b().

Referenced by __anyhit__kernel_optix_shadow_all_hit().

◆ uint16_unpack_from_uint_0()

ccl_device_inline uint uint16_unpack_from_uint_0 ( const uint  i)

Definition at line 336 of file util/math.h.

Referenced by __anyhit__kernel_optix_shadow_all_hit().

◆ uint16_unpack_from_uint_1()

ccl_device_inline uint uint16_unpack_from_uint_1 ( const uint  i)

Definition at line 341 of file util/math.h.

Referenced by __anyhit__kernel_optix_shadow_all_hit().

◆ wrapf()

ccl_device_inline float wrapf ( float  value,
float  max,
float  min 
)

Definition at line 438 of file util/math.h.

References floorf, max(), and min().

◆ xor_signmask()

ccl_device_inline float xor_signmask ( float  x,
int  y 
)

Definition at line 780 of file util/math.h.

References __float_as_int(), __int_as_float(), x, and y.

Referenced by isect_ray_tri_watertight_v3().