4 #ifndef __UTIL_MATH_H__
5 #define __UTIL_MATH_H__
12 #ifndef __KERNEL_GPU__
17 # include <hip/hip_vector_types.h>
20 #if !defined(__KERNEL_METAL__)
34 # define M_PI_F (3.1415926535897932f)
37 # define M_PI_2_F (1.5707963267948966f)
40 # define M_PI_4_F (0.7853981633974830f)
43 # define M_1_PI_F (0.3183098861837067f)
46 # define M_2_PI_F (0.6366197723675813f)
49 # define M_1_2PI_F (0.1591549430918953f)
52 # define M_SQRT_PI_8_F (0.6266570686577501f)
55 # define M_LN_2PI_F (1.8378770664093454f)
60 # define M_2PI_F (6.2831853071795864f)
63 # define M_4PI_F (12.566370614359172f)
68 # define M_SQRT2_F (1.4142135623730950f)
71 # define M_SQRT3_F (1.7320508075688772f)
74 # define M_LN2_F (0.6931471805599453f)
77 # define M_LN10_F (2.3025850929940457f)
82 #if !defined(__HIP__) && !defined(__KERNEL_ONEAPI__)
86 return (
a >
b) ?
a :
b;
91 return (
a <
b) ?
a :
b;
97 #if !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__)
98 # ifndef __KERNEL_ONEAPI__
104 # define isfinite(x) sycl::isfinite((x))
105 # define isnan(x) sycl::isnan((x))
110 return (
x > 0) ?
x : -
x;
115 return (
a >
b) ?
a :
b;
120 return (
a <
b) ?
a :
b;
125 return (
a >
b) ?
a :
b;
130 return (
a <
b) ?
a :
b;
135 return (
a >
b) ?
a :
b;
140 return (
a <
b) ?
a :
b;
153 return (
a >
b) ?
a :
b;
159 return (
a <
b) ?
a :
b;
164 return (
a >
b) ?
a :
b;
169 return (
a <
b) ?
a :
b;
174 return (
a >
b) ?
a :
b;
179 return (
a <
b) ?
a :
b;
209 #if !defined(__KERNEL_METAL__)
286 # ifdef __KERNEL_SSE__
287 return int4(_mm_castps_si128(f.m128));
296 # ifdef __KERNEL_SSE__
297 return float4(_mm_castsi128_ps(i.m128));
305 #if defined(__KERNEL_METAL__)
333 return (
a << 16) |
b;
350 return (
x << 1) > 0xff000000u;
357 return (f == f) && (
x == 0 ||
x == (1u << 31) || (f != 2.0f * f)) && !((
x << 1) > 0xff000000u);
366 #if !defined(__KERNEL_METAL__)
379 return a +
t * (
b -
a);
390 float t = (
x - edge0) / (edge1 - edge0);
398 #if defined(__KERNEL_CUDA__)
401 return __saturatef(
a);
403 #elif !defined(__KERNEL_METAL__)
406 return clamp(
a, 0.0f, 1.0f);
441 return (range != 0.0f) ? value - (range *
floorf((value -
min) / range)) :
min;
453 return fminf(
a,
b) - h * h * h * k * (1.0f / 6.0f);
462 return (f < 0.0f) ? -1.0f : 1.0f;
487 return (3.0f * ff - 2.0f * ff * f);
492 return (
x % m + m) % m;
517 return (
x -
a) / (
b -
a);
524 (((d + 3.0f * (
b -
c) -
a) *
x + (2.0f *
a - 5.0f *
b + 4.0f *
c - d)) *
x +
545 #if !defined(__KERNEL_METAL__)
548 template<
class A,
class B>
A lerp(
const A &
a,
const A &
b,
const B &
t)
550 return (
A)(
a * ((
B)1 -
t) +
b *
t);
571 if (
fabsf(
N.y) >= 0.999f) {
576 if (
fabsf(
N.z) >= 0.999f) {
583 if (
N.x !=
N.y ||
N.x !=
N.z)
598 x = (
a.x != 0.0f) ? 1.0f /
a.x : 0.0f;
599 y = (
a.y != 0.0f) ? 1.0f /
a.y : 0.0f;
600 z = (
a.z != 0.0f) ? 1.0f /
a.z : 0.0f;
609 x = (
b.x != 0.0f) ?
a.x /
b.x : 0.0f;
610 y = (
b.y != 0.0f) ?
a.y /
b.y : 0.0f;
611 z = (
b.z != 0.0f) ?
a.z /
b.z : 0.0f;
620 x = (
b.x != 0.0f) ?
a.x /
b.x : 0.0f;
621 y = (
b.y != 0.0f) ?
a.y /
b.y : 0.0f;
622 z = (
b.z != 0.0f) ?
a.z /
b.z : 0.0f;
630 else if (
b.z == 0.0f) {
637 else if (
b.y == 0.0f) {
645 else if (
b.z == 0.0f) {
660 r.x = ((costheta + (1 - costheta) * axis.
x * axis.
x) * p.
x) +
661 (((1 - costheta) * axis.
x * axis.
y - axis.
z * sintheta) * p.
y) +
662 (((1 - costheta) * axis.
x * axis.
z + axis.
y * sintheta) * p.
z);
664 r.y = (((1 - costheta) * axis.
x * axis.
y + axis.
z * sintheta) * p.
x) +
665 ((costheta + (1 - costheta) * axis.
y * axis.
y) * p.
y) +
666 (((1 - costheta) * axis.
y * axis.
z - axis.
x * sintheta) * p.
z);
668 r.z = (((1 - costheta) * axis.
x * axis.
z - axis.
y * sintheta) * p.
x) +
669 (((1 - costheta) * axis.
y * axis.
z + axis.
x * sintheta) * p.
y) +
670 ((costheta + (1 - costheta) * axis.
z * axis.
z) * p.
z);
684 #if defined(__KERNEL_METAL__)
685 return (f > 0.0f) ? rsqrt(f) : 0.0f;
687 return (f > 0.0f) ? 1.0f /
sqrtf(f) : 0.0f;
703 #ifdef __KERNEL_GPU__
709 if (
fmodf(-
y, 2.0f) == 0.0f)
730 return (
b != 0.0f) ?
a /
b : 0.0f;
743 return (
b != 0.0f) ?
fmodf(
a,
b) : 0.0f;
761 #ifdef __KERNEL_METAL__
766 const float _1_180 = 1.0f / 180.0f;
767 const float log2pi = 1.83787706641f;
768 const float logx =
log(
x);
769 return (log2pi - logx +
770 x * (logx * 2.0f +
log(
x *
sinh(1.0f /
x) + (_1_180 /
pow(
x, 6.0f))) - 2.0f)) *
787 return bits * (1.0f / (
float)0xFFFFFFFF);
790 #if !defined(__KERNEL_GPU__)
791 # if defined(__GNUC__)
792 # define popcount(x) __builtin_popcount(x)
797 uint i =
x & 0xaaaaaaaa;
798 i = i - ((i >> 1) & 0x55555555);
799 i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
800 i = (((i + (i >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
804 #elif defined(__KERNEL_ONEAPI__)
805 # define popcount(x) sycl::popcount(x)
806 #elif defined(__KERNEL_HIP__)
808 # define popcount(x) __popcll(x)
809 #elif !defined(__KERNEL_METAL__)
810 # define popcount(x) __popc(x)
815 #if defined(__KERNEL_CUDA__) || defined(__KERNEL_OPTIX__) || defined(__KERNEL_HIP__)
817 #elif defined(__KERNEL_METAL__)
819 #elif defined(__KERNEL_ONEAPI__)
824 unsigned long leading_zero = 0;
825 _BitScanReverse(&leading_zero,
x);
826 return (31 - leading_zero);
828 return __builtin_clz(
x);
835 #if defined(__KERNEL_CUDA__) || defined(__KERNEL_OPTIX__) || defined(__KERNEL_HIP__)
836 return (__ffs(
x) - 1);
837 #elif defined(__KERNEL_METAL__)
839 #elif defined(__KERNEL_ONEAPI__)
844 unsigned long ctz = 0;
845 _BitScanForward(&ctz,
x);
848 return __builtin_ctz(
x);
855 #if defined(__KERNEL_CUDA__) || defined(__KERNEL_OPTIX__) || defined(__KERNEL_HIP__)
857 #elif defined(__KERNEL_METAL__)
858 return (
x != 0) ? ctz(
x) + 1 : 0;
863 return __builtin_ffs(
x);
875 v = (co.
z + 1.0f) * 0.5f;
915 if ((
a < 0.0f) != (
b < 0.0f)) {
944 #ifndef __has_builtin
945 # define __has_builtin(v) 0
952 #if defined(__KERNEL_CUDA__)
954 #elif defined(__KERNEL_METAL__)
955 return reverse_bits(
x);
956 #elif defined(__aarch64__) || defined(_M_ARM64)
958 __asm__(
"rbit %w0, %w1" :
"=r"(
x) :
"r"(
x));
960 #elif defined(__arm__) && ((__ARM_ARCH > 7) || __ARM_ARCH == 6 && __ARM_ARCH_ISA_THUMB >= 2)
963 __asm__(
"rbit %0, %1" :
"=r"(
x) :
"r"(
x));
965 #elif __has_builtin(__builtin_bitreverse32)
966 return __builtin_bitreverse32(
x);
969 x = ((
x & 0x55555555) << 1) | ((
x & 0xAAAAAAAA) >> 1);
971 x = ((
x & 0x33333333) << 2) | ((
x & 0xCCCCCCCC) >> 2);
973 x = ((
x & 0x0F0F0F0F) << 4) | ((
x & 0xF0F0F0F0) >> 4);
976 return _byteswap_ulong(
x);
977 # elif defined(__INTEL_COMPILER)
981 return __builtin_bswap32(
x);
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_device_inline float3 pow(float3 v, float e)
ccl_device_inline float3 log(float3 v)
INLINE Rall1d< T, V, S > sinh(const Rall1d< T, V, S > &arg)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
vec_base< T, Size > normalize(const vec_base< T, Size > &v)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
unsigned __int64 uint64_t
ccl_device_inline float __uint_as_float(uint i)
ccl_device float safe_divide(float a, float b)
ccl_device_inline T * pointer_unpack_from_uint(const uint a, const uint b)
ccl_device_inline float inverse_lerp(float a, float b, float x)
ccl_device_inline uint __float_as_uint(float f)
ccl_device_inline float ensure_finite(float v)
ccl_device_inline int4 __float4_as_int4(float4 f)
ccl_device_inline int abs(int x)
ccl_device_inline float safe_sqrtf(float f)
ccl_device_inline uint uint16_unpack_from_uint_1(const uint i)
ccl_device_inline float pow22(float a)
ccl_device_inline int __float_as_int(float f)
ccl_device_inline int float_to_int(float f)
ccl_device_inline int ceil_to_int(float f)
ccl_device_inline float mix(float a, float b, float t)
ccl_device_inline float pow20(float a)
ccl_device_inline float compatible_signf(float f)
ccl_device_inline T min4(const T &a, const T &b, const T &c, const T &d)
ccl_device_inline float smoothstep(float edge0, float edge1, float x)
ccl_device_inline uint popcount(uint x)
ccl_device_inline uint count_leading_zeros(uint x)
ccl_device_inline float3 safe_divide_even_color(float3 a, float3 b)
CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN A lerp(const A &a, const A &b, const B &t)
ccl_device_inline int mod(int x, int m)
ccl_device_inline float triangle_area(ccl_private const float3 &v1, ccl_private const float3 &v2, ccl_private const float3 &v3)
ccl_device float safe_modulo(float a, float b)
ccl_device_inline float sqr(float a)
ccl_device_inline float pingpongf(float a, float b)
ccl_device_inline uint pointer_pack_to_uint_1(T *ptr)
ccl_device_inline uint32_t reverse_integer_bits(uint32_t x)
ccl_device_inline uint count_trailing_zeros(uint x)
ccl_device_inline float saturatef(float a)
ccl_device_inline float inversesqrtf(float f)
ccl_device float safe_acosf(float a)
ccl_device float compatible_powf(float x, float y)
ccl_device_inline float3 safe_divide_color(float3 a, float3 b)
ccl_device_inline float smoothminf(float a, float b, float k)
ccl_device_inline float2 map_to_sphere(const float3 co)
ccl_device_inline uint uint16_pack_to_uint(const uint a, const uint b)
ccl_device_inline bool isfinite_safe(float f)
ccl_device_inline int min(int a, int b)
ccl_device_inline uint pointer_pack_to_uint_0(T *ptr)
ccl_device_inline float4 float3_to_float4(const float3 a)
ccl_device_inline float precise_angle(float3 a, float3 b)
ccl_device_inline float2 map_to_tube(const float3 co)
ccl_device_inline uint next_power_of_two(uint x)
ccl_device_inline float floorfrac(float x, ccl_private int *i)
ccl_device_inline T max4(const T &a, const T &b, const T &c, const T &d)
ccl_device_inline uint as_uint(int i)
ccl_device_inline float nonzerof(float f, float eps)
ccl_device float safe_powf(float a, float b)
ccl_device_inline uint prev_power_of_two(uint x)
ccl_device_inline float3 safe_invert_color(float3 a)
ccl_device float safe_logf(float a, float b)
ccl_device_inline float fractf(float x)
ccl_device_inline bool compare_floats(float a, float b, float abs_diff, int ulp_diff)
ccl_device_inline int floor_to_int(float f)
ccl_device_inline bool isnan_safe(float f)
ccl_device_inline float beta(float x, float y)
ccl_device_inline uint uint16_unpack_from_uint_0(const uint i)
ccl_device_inline float3 float2_to_float3(const float2 a)
ccl_device_inline float signf(float f)
ccl_device_inline void make_orthonormals(const float3 N, ccl_private float3 *a, ccl_private float3 *b)
ccl_device_inline float xor_signmask(float x, int y)
ccl_device_inline float cubic_interp(float a, float b, float c, float d, float x)
ccl_device_inline uint find_first_set(uint x)
ccl_device_inline float3 float4_to_float3(const float4 a)
ccl_device_inline int as_int(uint i)
ccl_device float bits_to_01(uint bits)
ccl_device_inline int max(int a, int b)
ccl_device_inline float3 rotate_around_axis(float3 p, float3 axis, float angle)
ccl_device_inline float4 __int4_as_float4(int4 i)
ccl_device_inline float wrapf(float value, float max, float min)
ccl_device float safe_asinf(float a)
ccl_device_inline float smoothstepf(float f)
ccl_device_inline int clamp(int a, int mn, int mx)
ccl_device_inline float __int_as_float(int i)