1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#pragma OPENCL FP_CONTRACT ON
#define INL_FUNCTION_NAME(fnName) fnName
#define INL_TRANSFORM_FN_1D(fnName) static inline float fnName
#define INL_CONVERT_3D_2D_FN(fnName) static inline float2 fnName
#define INL_CONVERT_2D_3D_FN(fnName) static inline float3 fnName
#define INL_PERSPECTIVE_TRANSFORM_FN(fnName) static inline float3 fnName
#define INL_ROTATION_TRANSFORM_FN(fnName) static inline float3 fnName
#define INL_DISTORTION_TRANSFORM_FN(fnName) static inline float2 fnName
#define length_vs fast_length
static inline float invLength2(float2 v) { return native_rsqrt(v.x * v.x + v.y * v.y); }
static inline float invLength3(float3 v) { return native_rsqrt(v.x * v.x + v.y * v.y + v.z * v.z); }
#define acosf_vs acos
#define asinf_vs asin
#define atan2f_vs atan2
#define clampf_vs clamp
#define cosf_vs cos
#define fabsf_vs fabs
#define powf_vs pow
#define sinf_vs sin
#define sqrtf_vs sqrt
#define tanf_vs tan
#define acos_vs acos
#define cos_vs cos
#define fabs_vs fabs
#define pow_vs pow
#define sqrt_vs sqrt
#define solve_float_t float
#define solve_float_t2 float2
#define solve_float_t3 float3
#define make_solve_float_t2 make_float2
#define make_solve_float_t3 make_float3
#define solveQuartic_vs solveQuartic
#ifndef make_float2
#define make_float2(A, B) (float2)((A), (B))
#endif // make_float2
#ifndef make_float3
#define make_float3(A, B, C) (float3)((A), (B), (C))
#endif // make_float3
#ifndef make_float4
#define make_float4(A, B, C, D) (float4)((A), (B), (C), (D))
#endif // make_float4
#define PI_F_VS M_PI_F
#undef FN_NAME
#undef INL_FN_FLOAT
#undef INL_FN_FLOAT2
#undef INL_FN_FLOAT3
#undef INL_FN_QUARTIC_SOL
#define FN_NAME(fnName) fnName
#define INL_FN_FLOAT(fnName) static inline solve_float_t fnName
#define INL_FN_FLOAT2(fnName) static inline solve_float_t2 fnName
#define INL_FN_FLOAT3(fnName) static inline solve_float_t3 fnName
#define INL_FN_QUARTIC_SOL(fnName) static inline vsQuarticSolution fnName
#define convert_float (float)
#include "backend/common/core/quarticSolver.gpu"
#include "backend/common/core/transformStack.gpu"
#undef INL_TRANSFORM_FN_1D
#undef INL_CONVERT_3D_2D_FN
#undef INL_CONVERT_2D_3D_FN
#undef INL_PERSPECTIVE_TRANSFORM_FN
#undef INL_ROTATION_TRANSFORM_FN
#undef INL_DISTORTION_TRANSFORM_FN