Blender V4.5
gpu_glsl_cpp_stubs.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
26
27#pragma once
28
29#include <type_traits>
30
31#define assert(assertion)
32#define printf(...)
33
34/* Some compilers complain about lack of return values. Keep it short. */
35#define RET \
36 { \
37 return {}; \
38 }
39
40/* -------------------------------------------------------------------- */
43
44template<typename T, int Sz> struct VecBase {};
45
46template<typename T, int Sz> struct VecOp {
48
49 const T &operator[](int) const
50 {
51 return *reinterpret_cast<const T *>(this);
52 }
54 {
55 return *reinterpret_cast<T *>(this);
56 }
57
58#define STD_OP \
59 template<typename U = T, typename std::enable_if_t<!std::is_same_v<bool, U>> * = nullptr>
60
62 STD_OP VecT operator-() const RET;
63
64 STD_OP friend VecT operator+(VecT, VecT) RET;
65 STD_OP friend VecT operator-(VecT, VecT) RET;
66 STD_OP friend VecT operator/(VecT, VecT) RET;
67 STD_OP friend VecT operator*(VecT, VecT) RET;
68
69 STD_OP friend VecT operator+(VecT, T) RET;
70 STD_OP friend VecT operator-(VecT, T) RET;
71 STD_OP friend VecT operator/(VecT, T) RET;
72 STD_OP friend VecT operator*(VecT, T) RET;
73
74 STD_OP friend VecT operator+(T, VecT) RET;
75 STD_OP friend VecT operator-(T, VecT) RET;
76 STD_OP friend VecT operator/(T, VecT) RET;
77 STD_OP friend VecT operator*(T, VecT) RET;
78
79 STD_OP friend VecT operator+=(VecT, VecT) RET;
80 STD_OP friend VecT operator-=(VecT, VecT) RET;
81 STD_OP friend VecT operator/=(VecT, VecT) RET;
82 STD_OP friend VecT operator*=(VecT, VecT) RET;
83
84 STD_OP friend VecT operator+=(VecT, T) RET;
85 STD_OP friend VecT operator-=(VecT, T) RET;
86 STD_OP friend VecT operator/=(VecT, T) RET;
87 STD_OP friend VecT operator*=(VecT, T) RET;
88
89#define INT_OP \
90 template<typename U = T, \
91 typename std::enable_if_t<std::is_integral_v<U>> * = nullptr, \
92 typename std::enable_if_t<!std::is_same_v<bool, U>> * = nullptr>
93
95
100
105
110
115
120
125
130
135
136#undef INT_OP
137};
138
139template<typename T, int Sz> struct SwizzleBase : VecOp<T, Sz> {
141
142 SwizzleBase() = default;
144
145 constexpr VecT operator=(const VecT &) RET;
146 operator VecT() const RET;
147};
148
149#define SWIZZLE_XY(T) \
150 SwizzleBase<T, 2> xx, xy, yx, yy; \
151 SwizzleBase<T, 3> xxx, xxy, xyx, xyy, yxx, yxy, yyx, yyy; \
152 SwizzleBase<T, 4> xxxx, xxxy, xxyx, xxyy, xyxx, xyxy, xyyx, xyyy, yxxx, yxxy, yxyx, yxyy, yyxx, \
153 yyxy, yyyx, yyyy;
154
155#define SWIZZLE_RG(T) \
156 SwizzleBase<T, 2> rr, rg, gr, gg; \
157 SwizzleBase<T, 3> rrr, rrg, rgr, rgg, grr, grg, ggr, ggg; \
158 SwizzleBase<T, 4> rrrr, rrrg, rrgr, rrgg, rgrr, rgrg, rggr, rggg, grrr, grrg, grgr, grgg, ggrr, \
159 ggrg, gggr, gggg;
160
161#define SWIZZLE_XYZ(T) \
162 SWIZZLE_XY(T) \
163 SwizzleBase<T, 2> xz, yz, zx, zy, zz; \
164 SwizzleBase<T, 3> xxz, xyz, xzx, xzy, xzz, yxz, yyz, yzx, yzy, yzz, zxx, zxy, zxz, zyx, zyy, \
165 zyz, zzx, zzy, zzz; \
166 SwizzleBase<T, 4> xxxz, xxyz, xxzx, xxzy, xxzz, xyxz, xyyz, xyzx, xyzy, xyzz, xzxx, xzxy, xzxz, \
167 xzyx, xzyy, xzyz, xzzx, xzzy, xzzz, yxxz, yxyz, yxzx, yxzy, yxzz, yyxz, yyyz, yyzx, yyzy, \
168 yyzz, yzxx, yzxy, yzxz, yzyx, yzyy, yzyz, yzzx, yzzy, yzzz, zxxx, zxxy, zxxz, zxyx, zxyy, \
169 zxyz, zxzx, zxzy, zxzz, zyxx, zyxy, zyxz, zyyx, zyyy, zyyz, zyzx, zyzy, zyzz, zzxx, zzxy, \
170 zzxz, zzyx, zzyy, zzyz, zzzx, zzzy, zzzz;
171
172#define SWIZZLE_RGB(T) \
173 SWIZZLE_RG(T) \
174 SwizzleBase<T, 2> rb, gb, br, bg, bb; \
175 SwizzleBase<T, 3> rrb, rgb, rbr, rbg, rbb, grb, ggb, gbr, gbg, gbb, brr, brg, brb, bgr, bgg, \
176 bgb, bbr, bbg, bbb; \
177 SwizzleBase<T, 4> rrrb, rrgb, rrbr, rrbg, rrbb, rgrb, rggb, rgbr, rgbg, rgbb, rbrr, rbrg, rbrb, \
178 rbgr, rbgg, rbgb, rbbr, rbbg, rbbb, grrb, grgb, grbr, grbg, grbb, ggrb, gggb, ggbr, ggbg, \
179 ggbb, gbrr, gbrg, gbrb, gbgr, gbgg, gbgb, gbbr, gbbg, gbbb, brrr, brrg, brrb, brgr, brgg, \
180 brgb, brbr, brbg, brbb, bgrr, bgrg, bgrb, bggr, bggg, bggb, bgbr, bgbg, bgbb, bbrr, bbrg, \
181 bbrb, bbgr, bbgg, bbgb, bbbr, bbbg, bbbb;
182
183#define SWIZZLE_XYZW(T) \
184 SWIZZLE_XYZ(T) \
185 SwizzleBase<T, 2> xw, yw, zw, wx, wy, wz, ww; \
186 SwizzleBase<T, 3> xxw, xyw, xzw, xwx, xwy, xwz, xww, yxw, yyw, yzw, ywx, ywy, ywz, yww, zxw, \
187 zyw, zzw, zwx, zwy, zwz, zww, wxx, wxy, wxz, wxw, wyx, wyy, wyz, wyw, wzx, wzy, wzz, wzw, \
188 wwx, wwy, wwz, www; \
189 SwizzleBase<T, 4> xxxw, xxyw, xxzw, xxwx, xxwy, xxwz, xxww, xyxw, xyyw, xyzw, xywx, xywy, xywz, \
190 xyww, xzxw, xzyw, xzzw, xzwx, xzwy, xzwz, xzww, xwxx, xwxy, xwxz, xwxw, xwyx, xwyy, xwyz, \
191 xwyw, xwzx, xwzy, xwzz, xwzw, xwwx, xwwy, xwwz, xwww, yxxw, yxyw, yxzw, yxwx, yxwy, yxwz, \
192 yxww, yyxw, yyyw, yyzw, yywx, yywy, yywz, yyww, yzxw, yzyw, yzzw, yzwx, yzwy, yzwz, yzww, \
193 ywxx, ywxy, ywxz, ywxw, ywyx, ywyy, ywyz, ywyw, ywzx, ywzy, ywzz, ywzw, ywwx, ywwy, ywwz, \
194 ywww, zxxw, zxyw, zxzw, zxwx, zxwy, zxwz, zxww, zyxw, zyyw, zyzw, zywx, zywy, zywz, zyww, \
195 zzxw, zzyw, zzzw, zzwx, zzwy, zzwz, zzww, zwxx, zwxy, zwxz, zwxw, zwyx, zwyy, zwyz, zwyw, \
196 zwzx, zwzy, zwzz, zwzw, zwwx, zwwy, zwwz, zwww, wxxx, wxxy, wxxz, wxxw, wxyx, wxyy, wxyz, \
197 wxyw, wxzx, wxzy, wxzz, wxzw, wxwx, wxwy, wxwz, wxww, wyxx, wyxy, wyxz, wyxw, wyyx, wyyy, \
198 wyyz, wyyw, wyzx, wyzy, wyzz, wyzw, wywx, wywy, wywz, wyww, wzxx, wzxy, wzxz, wzxw, wzyx, \
199 wzyy, wzyz, wzyw, wzzx, wzzy, wzzz, wzzw, wzwx, wzwy, wzwz, wzww, wwxx, wwxy, wwxz, wwxw, \
200 wwyx, wwyy, wwyz, wwyw, wwzx, wwzy, wwzz, wwzw, wwwx, wwwy, wwwz, wwww;
201
202#define SWIZZLE_RGBA(T) \
203 SWIZZLE_RGB(T) \
204 SwizzleBase<T, 2> ra, ga, ba, ar, ag, ab, aa; \
205 SwizzleBase<T, 3> rra, rga, rba, rar, rag, rab, raa, gra, gga, gba, gar, gag, gab, gaa, bra, \
206 bga, bba, bar, bag, bab, baa, arr, arg, arb, ara, agr, agg, agb, aga, abr, abg, abb, aba, \
207 aar, aag, aab, aaa; \
208 SwizzleBase<T, 4> rrra, rrga, rrba, rrar, rrag, rrab, rraa, rgra, rgga, rgba, rgar, rgag, rgab, \
209 rgaa, rbra, rbga, rbba, rbar, rbag, rbab, rbaa, rarr, rarg, rarb, rara, ragr, ragg, ragb, \
210 raga, rabr, rabg, rabb, raba, raar, raag, raab, raaa, grra, grga, grba, grar, grag, grab, \
211 graa, ggra, ggga, ggba, ggar, ggag, ggab, ggaa, gbra, gbga, gbba, gbar, gbag, gbab, gbaa, \
212 garr, garg, garb, gara, gagr, gagg, gagb, gaga, gabr, gabg, gabb, gaba, gaar, gaag, gaab, \
213 gaaa, brra, brga, brba, brar, brag, brab, braa, bgra, bgga, bgba, bgar, bgag, bgab, bgaa, \
214 bbra, bbga, bbba, bbar, bbag, bbab, bbaa, barr, barg, barb, bara, bagr, bagg, bagb, baga, \
215 babr, babg, babb, baba, baar, baag, baab, baaa, arrr, arrg, arrb, arra, argr, argg, argb, \
216 arga, arbr, arbg, arbb, arba, arar, arag, arab, araa, agrr, agrg, agrb, agra, aggr, aggg, \
217 aggb, agga, agbr, agbg, agbb, agba, agar, agag, agab, agaa, abrr, abrg, abrb, abra, abgr, \
218 abgg, abgb, abga, abbr, abbg, abbb, abba, abar, abag, abab, abaa, aarr, aarg, aarb, aara, \
219 aagr, aagg, aagb, aaga, aabr, aabg, aabb, aaba, aaar, aaag, aaab, aaaa;
220
221template<typename T> struct VecBase<T, 1> {
222 VecBase() = default;
223 template<typename U> explicit VecBase(VecOp<U, 1>) {}
225
226 operator T() RET;
227};
228
229template<typename T> struct VecBase<T, 2> : VecOp<T, 2> {
230 private:
231 /* Weird non-zero value to avoid error about division by zero in constexpr. */
232 static constexpr T V = T(0.123f);
233
234 public:
235 union {
236 struct {
237 T x, y;
238 };
239 struct {
240 T r, g;
241 };
242 SWIZZLE_XY(T);
243 SWIZZLE_RG(T);
244 };
245
246 VecBase() = default;
247 template<typename U> explicit VecBase(VecOp<U, 2>) {}
248 constexpr explicit VecBase(T) : x(V), y(V) {}
249 /* Implemented correctly for GCC to compile the constexpr float2 arrays. */
250 constexpr explicit VecBase(T x_, T y_) : x(x_), y(y_) {}
251};
252
253template<typename T> struct VecBase<T, 3> : VecOp<T, 3> {
254 private:
255 /* Weird non-zero value to avoid error about division by zero in constexpr. */
256 static constexpr T V = T(0.123f);
257
258 public:
259 union {
260 struct {
261 T x, y, z;
262 };
263 struct {
264 T r, g, b;
265 };
266 SWIZZLE_XYZ(T);
267 SWIZZLE_RGB(T);
268 };
269
270 VecBase() = default;
271 template<typename U> explicit VecBase(VecOp<U, 3>) {}
272 constexpr explicit VecBase(T) : x(V), y(V), z(V) {}
273 /* Implemented correctly for GCC to compile the constexpr gl_WorkGroupSize. */
274 constexpr explicit VecBase(T x_, T y_, T z_) : x(x_), y(y_), z(z_) {}
275 constexpr explicit VecBase(VecOp<T, 2>, T) : x(V), y(V), z(V) {}
276 constexpr explicit VecBase(T, VecOp<T, 2>) : x(V), y(V), z(V) {}
277};
278
279template<typename T> struct VecBase<T, 4> : VecOp<T, 4> {
280 private:
281 /* Weird non-zero value to avoid error about division by zero in constexpr. */
282 static constexpr T V = T(0.123f);
283
284 public:
285 union {
286 struct {
287 T x, y, z, w;
288 };
289 struct {
290 T r, g, b, a;
291 };
294 };
295
296 VecBase() = default;
297 template<typename U> explicit VecBase(VecOp<U, 4>) {}
298 constexpr explicit VecBase(T) : x(V), y(V), z(V), w(V) {}
299 /* Implemented correctly for GCC to compile the constexpr. */
300 constexpr explicit VecBase(T x_, T y_, T z_, T w_) : x(x_), y(y_), z(z_), w(w_) {}
301 constexpr explicit VecBase(VecOp<T, 2>, T, T) : x(V), y(V), z(V), w(V) {}
302 constexpr explicit VecBase(T, VecOp<T, 2>, T) : x(V), y(V), z(V), w(V) {}
303 constexpr explicit VecBase(T, T, VecOp<T, 2>) : x(V), y(V), z(V), w(V) {}
304 constexpr explicit VecBase(VecOp<T, 2>, VecOp<T, 2>) : x(V), y(V), z(V), w(V) {}
305 constexpr explicit VecBase(VecOp<T, 3>, T) : x(V), y(V), z(V), w(V) {}
306 constexpr explicit VecBase(T, VecOp<T, 3>) : x(V), y(V), z(V), w(V) {}
307};
308
309/* Boolean vectors do not have operators and are not convertible from other types. */
310
311template<> struct VecBase<bool, 2> : VecOp<bool, 2> {
312 union {
313 struct {
314 bool x, y;
315 };
316 SWIZZLE_XY(bool);
317 };
318
319 VecBase() = default;
320 explicit VecBase(bool) {}
321 explicit VecBase(bool, bool) {}
322 /* Should be forbidden, but is used by SMAA. */
324};
325
326template<> struct VecBase<bool, 3> : VecOp<bool, 3> {
327 union {
328 struct {
329 bool x, y, z;
330 };
331 SWIZZLE_XYZ(bool);
332 };
333
334 VecBase() = default;
335 explicit VecBase(bool) {}
336 explicit VecBase(bool, bool, bool) {}
337 explicit VecBase(VecOp<bool, 2>, bool) {}
338 explicit VecBase(bool, VecOp<bool, 2>) {}
339};
340
341template<> struct VecBase<bool, 4> : VecOp<bool, 4> {
342 union {
343 struct {
344 bool x, y, z, w;
345 };
346 SWIZZLE_XYZW(bool);
347 };
348
349 VecBase() = default;
350 explicit VecBase(bool) {}
351 explicit VecBase(bool, bool, bool, bool) {}
352 explicit VecBase(VecOp<bool, 2>, bool, bool) {}
353 explicit VecBase(bool, VecOp<bool, 2>, bool) {}
354 explicit VecBase(bool, bool, VecOp<bool, 2>) {}
356 explicit VecBase(VecOp<bool, 3>, bool) {}
357 explicit VecBase(bool, VecOp<bool, 3>) {}
358};
359
360using uint = unsigned int;
361using uint32_t = unsigned int; /* For typed enums. */
362
366
370
374
375using uchar = unsigned int;
379
383
384using ushort = unsigned short;
388
392
393using half = float;
397
401
403
414
416
417/* -------------------------------------------------------------------- */
420
421template<int C, int R> struct MatBase {};
422
423template<int C, int R> struct MatOp {
427
428 const ColT &operator[](int) const
429 {
430 return *reinterpret_cast<const ColT *>(this);
431 }
433 {
434 return *reinterpret_cast<ColT *>(this);
435 }
436
438 MatT operator-() RET;
439
440 MatT operator*(MatT) const RET;
441
442 friend RowT operator*(ColT, MatT) RET;
443 friend ColT operator*(MatT, RowT) RET;
444};
445
446template<int R> struct MatBase<2, R> : MatOp<2, R> {
447 using T = float;
450
451 MatBase() = default;
452 explicit MatBase(T) {}
453 explicit MatBase(T, T, T, T) {}
454 explicit MatBase(ColT, ColT) {}
455 template<int OtherC, int OtherR> explicit MatBase(const MatBase<OtherC, OtherR> &) {}
456};
457
458template<int R> struct MatBase<3, R> : MatOp<3, R> {
459 using T = float;
462
463 MatBase() = default;
464 explicit MatBase(T) {}
465 explicit MatBase(T, T, T, T, T, T, T, T, T) {}
466 explicit MatBase(ColT, ColT, ColT) {}
467 template<int OtherC, int OtherR> explicit MatBase(const MatBase<OtherC, OtherR> &) {}
468};
469
470template<int R> struct MatBase<4, R> : MatOp<4, R> {
471 using T = float;
473 ColT x, y, z, w;
474
475 MatBase() = default;
476 explicit MatBase(T) {}
477 explicit MatBase(T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T) {}
478 explicit MatBase(ColT, ColT, ColT, ColT) {}
479 template<int OtherC, int OtherR> explicit MatBase(const MatBase<OtherC, OtherR> &) {}
480};
481
491
492/* Matrix reshaping functions. */
493#define RESHAPE(mat_to, mat_from, ...) \
494 mat_to to_##mat_to(mat_from m) \
495 { \
496 return mat_to(__VA_ARGS__); \
497 }
498
499/* clang-format off */
500RESHAPE(float2x2, float3x3, m[0].xy, m[1].xy)
501RESHAPE(float2x2, float4x4, m[0].xy, m[1].xy)
502RESHAPE(float3x3, float4x4, m[0].xyz, m[1].xyz, m[2].xyz)
503RESHAPE(float3x3, float2x2, m[0].x, m[0].y, 0, m[1].x, m[1].y, 0, 0, 0, 1)
504RESHAPE(float4x4, float2x2, m[0].x, m[0].y, 0, 0, m[1].x, m[1].y, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
505RESHAPE(float4x4, float3x3, m[0].x, m[0].y, m[0].z, 0, m[1].x, m[1].y, m[1].z, 0, m[2].x, m[2].y, m[2].z, 0, 0, 0, 0, 1)
506/* clang-format on */
507/* TODO(fclem): Remove. Use Transform instead. */
508RESHAPE(float3x3, float3x4, m[0].xyz, m[1].xyz, m[2].xyz)
509#undef RESHAPE
510
512
513/* -------------------------------------------------------------------- */
516
517template<typename T,
518 int Dimensions,
519 bool Cube = false,
520 bool Array = false,
521 bool Atomic = false,
522 bool Depth = false>
524 static constexpr int coord_dim = Dimensions + int(Cube) + int(Array);
525 static constexpr int deriv_dim = Dimensions + int(Cube);
526 static constexpr int extent_dim = Dimensions + int(Array);
527
533};
534
535#define TEX_TEMPLATE \
536 template<typename T, \
537 typename IntCoord = typename T::int_coord_type, \
538 typename FltCoord = typename T::flt_coord_type, \
539 typename DerivVec = typename T::derivative_type, \
540 typename DataVec = typename T::data_vec_type, \
541 typename SizeVec = typename T::size_vec_type>
542
544TEX_TEMPLATE DataVec texelFetch(T, IntCoord, int) RET;
545TEX_TEMPLATE DataVec texelFetchOffset(T, IntCoord, int, IntCoord) RET;
546TEX_TEMPLATE DataVec texture(T, FltCoord, float /*bias*/ = 0.0f) RET;
547TEX_TEMPLATE DataVec textureGather(T, FltCoord) RET;
548TEX_TEMPLATE DataVec textureGrad(T, FltCoord, DerivVec, DerivVec) RET;
549TEX_TEMPLATE DataVec textureLod(T, FltCoord, float) RET;
550TEX_TEMPLATE DataVec textureLodOffset(T, FltCoord, float, IntCoord) RET;
551
552#undef TEX_TEMPLATE
553
566
573
577
581
586
591
596
597/* Sampler Buffers do not have LOD. */
601
603
604/* -------------------------------------------------------------------- */
607
608template<typename T, int Dimensions, bool Array = false, bool Atomic = false> struct ImageBase {
609 static constexpr int coord_dim = Dimensions + int(Array);
610
614};
615
616#define IMG_TEMPLATE \
617 template<typename T, \
618 typename IntCoord = typename T::int_coord_type, \
619 typename DataVec = typename T::data_vec_type, \
620 typename SizeVec = typename T::size_vec_type>
621
622IMG_TEMPLATE SizeVec imageSize(const T &) RET;
623IMG_TEMPLATE DataVec imageLoad(const T &, IntCoord) RET;
624IMG_TEMPLATE void imageStore(T &, IntCoord, DataVec) {}
626/* Cannot write to a read only image. */
627IMG_TEMPLATE void imageStore(const T &, IntCoord, DataVec) = delete;
628IMG_TEMPLATE void imageFence(const T &) = delete;
629
630#define imageLoadFast imageLoad
631#define imageStoreFast imageStore
632
641/* Cannot write to a read only image. */
642IMG_TEMPLATE uint imageAtomicAdd(const T &, IntCoord, uint) = delete;
643IMG_TEMPLATE uint imageAtomicMin(const T &, IntCoord, uint) = delete;
644IMG_TEMPLATE uint imageAtomicMax(const T &, IntCoord, uint) = delete;
645IMG_TEMPLATE uint imageAtomicAnd(const T &, IntCoord, uint) = delete;
646IMG_TEMPLATE uint imageAtomicXor(const T &, IntCoord, uint) = delete;
647IMG_TEMPLATE uint imageAtomicOr(const T &, IntCoord, uint) = delete;
648IMG_TEMPLATE uint imageAtomicExchange(const T &, IntCoord, uint) = delete;
649IMG_TEMPLATE uint imageAtomicCompSwap(const T &, IntCoord, uint, uint) = delete;
650
651#undef IMG_TEMPLATE
652
662
669
674
677
678/* Forbid Cube and cube arrays. Bind them as 3D textures instead. */
679
681
682/* -------------------------------------------------------------------- */
685
690template<typename T, int D> VecBase<bool, D> equal(VecOp<T, D>, VecOp<T, D>) RET;
692template<int D> bool any(VecOp<bool, D>) RET;
693template<int D> bool all(VecOp<bool, D>) RET;
694/* `not` is a C++ keyword that aliases the `!` operator. Simply overload it. */
696
705int bitCount(int) RET;
713
718int findLSB(int) RET;
720int findMSB(int) RET;
722
723/* Math Functions. */
724
725/* NOTE: Declared inside a namespace and exposed behind macros to prevent
726 * errors on VS2019 due to `corecrt_math` conflicting functions. */
727namespace glsl {
728template<typename T> constexpr T abs(T) RET;
729/* TODO(fclem): These should be restricted to floats. */
730template<typename T> constexpr T ceil(T) RET;
731template<typename T> constexpr T exp(T) RET;
732template<typename T> constexpr T exp2(T) RET;
733template<typename T> constexpr T floor(T) RET;
734template<typename T> T fma(T, T, T) RET;
735float fma(float, float, float) RET;
736template<typename T> T frexp(T, T) RET;
737bool isinf(float) RET;
739bool isnan(float) RET;
741template<typename T> constexpr T log(T) RET;
742template<typename T> constexpr T log2(T) RET;
743template<typename T> T modf(T, T);
744template<typename T, typename U> constexpr T pow(T, U) RET;
745template<typename T> constexpr T round(T) RET;
746template<typename T> constexpr T sqrt(T) RET;
747template<typename T> constexpr T trunc(T) RET;
748template<typename T, typename U> T ldexp(T, U) RET;
749
750template<typename T> constexpr T acos(T) RET;
751template<typename T> T acosh(T) RET;
752template<typename T> constexpr T asin(T) RET;
753template<typename T> T asinh(T) RET;
754template<typename T> T atan(T, T) RET;
755template<typename T> T atan(T) RET;
756template<typename T> T atanh(T) RET;
757template<typename T> constexpr T cos(T) RET;
758template<typename T> T cosh(T) RET;
759template<typename T> constexpr T sin(T) RET;
760template<typename T> T sinh(T) RET;
761template<typename T> T tan(T) RET;
762template<typename T> T tanh(T) RET;
763} // namespace glsl
764
765#define abs glsl::abs
766#define ceil glsl::ceil
767#define exp glsl::exp
768#define exp2 glsl::exp2
769#define floor glsl::floor
770#define fma glsl::fma
771#define frexp glsl::frexp
772#define isinf glsl::isinf
773#define isnan glsl::isnan
774#define log glsl::log
775#define log2 glsl::log2
776#define modf glsl::modf
777#define pow glsl::pow
778#define round glsl::round
779#define sqrt glsl::sqrt
780#define trunc glsl::trunc
781#define ldexp glsl::ldexp
782#define acos glsl::acos
783#define acosh glsl::acosh
784#define asin glsl::asin
785#define asinh glsl::asinh
786#define atan glsl::atan
787#define atanh glsl::atanh
788#define cos glsl::cos
789#define cosh glsl::cosh
790#define sin glsl::sin
791#define sinh glsl::sinh
792#define tan glsl::tan
793#define tanh glsl::tanh
794
795template<typename T> constexpr T max(T, T) RET;
796template<typename T> constexpr T min(T, T) RET;
797template<typename T> constexpr T sign(T) RET;
798template<typename T, typename U> constexpr T clamp(T, U, U) RET;
799template<typename T> constexpr T clamp(T, float, float) RET;
800template<typename T, typename U> constexpr T max(T, U) RET;
801template<typename T, typename U> constexpr T min(T, U) RET;
802/* TODO(fclem): These should be restricted to floats. */
803template<typename T> T fract(T) RET;
804template<typename T> constexpr T inversesqrt(T) RET;
805constexpr float mod(float, float) RET;
806template<int D> VecBase<float, D> constexpr mod(VecOp<float, D>, float) RET;
808template<typename T> T smoothstep(T, T, T) RET;
809float step(float, float) RET;
812float smoothstep(float, float, float) RET;
813template<int D> VecBase<float, D> smoothstep(float, float, VecOp<float, D>) RET;
814
815template<typename T> constexpr T degrees(T) RET;
816template<typename T> constexpr T radians(T) RET;
817
818/* Declared explicitly to avoid type errors. */
819float mix(float, float, float) RET;
823
824#define select(A, B, C) mix(A, B, C)
825
827template<int D> float dot(VecOp<float, D>, VecOp<float, D>) RET;
829template<int D> float length(VecOp<float, D>) RET;
831
840
841/* Derivative functions. */
842template<typename T> T gpu_dfdx(T) RET;
843template<typename T> T gpu_dfdy(T) RET;
844template<typename T> T gpu_fwidth(T) RET;
845
846/* Discards the output of the current fragment shader invocation and halts its execution. */
848
849/* Geometric functions. */
851template<typename T, int D> VecBase<T, D> reflect(VecOp<T, D>, VecOp<T, D>) RET;
852template<typename T, int D> VecBase<T, D> refract(VecOp<T, D>, VecOp<T, D>, float) RET;
853
854/* Atomic operations. */
855int atomicAdd(int &, int) RET;
856int atomicAnd(int &, int) RET;
857int atomicOr(int &, int) RET;
858int atomicXor(int &, int) RET;
859int atomicMin(int &, int) RET;
860int atomicMax(int &, int) RET;
861int atomicExchange(int &, int) RET;
862int atomicCompSwap(int &, int, int) RET;
871
872/* Packing functions. */
883
884/* Matrices functions. */
885template<int C, int R> float determinant(MatBase<C, R>) RET;
886template<int C, int R> MatBase<C, R> inverse(MatBase<C, R>) RET;
887template<int C, int R> MatBase<R, C> transpose(MatBase<C, R>) RET;
888
889#undef RET
890
892
893/* -------------------------------------------------------------------- */
896
898
899extern const int gl_VertexID;
900extern const int gl_InstanceID;
901extern const int gl_BaseVertex;
902extern const int gpu_BaseInstance;
903extern const int gpu_InstanceIndex;
905float gl_PointSize = 0;
906float gl_ClipDistance[6] = {0};
907int gpu_Layer = 0;
909
910} // namespace gl_VertexShader
911
913
914extern const float4 gl_FragCoord;
915const bool gl_FrontFacing = true;
917const int gl_PrimitiveID = 0;
918float gl_FragDepth = 0;
919const float gl_ClipDistance[6] = {0};
920const int gpu_Layer = 0;
921const int gpu_ViewportIndex = 0;
922
923} // namespace gl_FragmentShader
924
926
927constexpr uint3 gl_WorkGroupSize = uint3(16, 16, 16);
928extern const uint3 gl_NumWorkGroups;
929extern const uint3 gl_WorkGroupID;
930extern const uint3 gl_LocalInvocationID;
931extern const uint3 gl_GlobalInvocationID;
932extern const uint gl_LocalInvocationIndex;
933
934} // namespace gl_ComputeShader
935
937
938/* -------------------------------------------------------------------- */
941
942/* Note: Cannot easily mutate them. Pass every by copy for now. */
943
944/* Pass argument by reference. */
945#define inout
946/* Pass argument by reference but only write to it. Its initial value is undefined. */
947#define out
948/* Pass argument by copy (default). */
949#define in
950
951/* Decorate a variable in global scope that is common to all threads in a thread-group. */
952#define shared
953
954namespace gl_ComputeShader {
955void barrier() {}
961} // namespace gl_ComputeShader
962
964
965/* -------------------------------------------------------------------- */
968
969/* Array syntax compatibility. */
970/* clang-format off */
971#define float_array(...) { __VA_ARGS__ }
972#define float2_array(...) { __VA_ARGS__ }
973#define float3_array(...) { __VA_ARGS__ }
974#define float4_array(...) { __VA_ARGS__ }
975#define int_array(...) { __VA_ARGS__ }
976#define int2_array(...) { __VA_ARGS__ }
977#define int3_array(...) { __VA_ARGS__ }
978#define int4_array(...) { __VA_ARGS__ }
979#define uint_array(...) { __VA_ARGS__ }
980#define uint2_array(...) { __VA_ARGS__ }
981#define uint3_array(...) { __VA_ARGS__ }
982#define uint4_array(...) { __VA_ARGS__ }
983#define bool_array(...) { __VA_ARGS__ }
984#define bool2_array(...) { __VA_ARGS__ }
985#define bool3_array(...) { __VA_ARGS__ }
986#define bool4_array(...) { __VA_ARGS__ }
987/* clang-format on */
988
989#define METAL_CONSTRUCTOR_1(class_name, t1, m1) \
990 class_name() = default; \
991 class_name(t1 m1##_) : m1(m1##_){};
992
993#define METAL_CONSTRUCTOR_2(class_name, t1, m1, t2, m2) \
994 class_name() = default; \
995 class_name(t1 m1##_, t2 m2##_) : m1(m1##_), m2(m2##_){};
996
997#define METAL_CONSTRUCTOR_3(class_name, t1, m1, t2, m2, t3, m3) \
998 class_name() = default; \
999 class_name(t1 m1##_, t2 m2##_, t3 m3##_) : m1(m1##_), m2(m2##_), m3(m3##_){};
1000
1001#define METAL_CONSTRUCTOR_4(class_name, t1, m1, t2, m2, t3, m3, t4, m4) \
1002 class_name() = default; \
1003 class_name(t1 m1##_, t2 m2##_, t3 m3##_, t4 m4##_) \
1004 : m1(m1##_), m2(m2##_), m3(m3##_), m4(m4##_){};
1005
1007
1008/* Use to suppress `-Wimplicit-fallthrough` (in place of `break`). */
1009#ifndef ATTR_FALLTHROUGH
1010# ifdef __GNUC__
1011# define ATTR_FALLTHROUGH __attribute__((fallthrough))
1012# else
1013# define ATTR_FALLTHROUGH ((void)0)
1014# endif
1015#endif
1016
1017/* GLSL main function must return void. C++ need to return int.
1018 * Inject real main (C++) inside the GLSL main definition. */
1019#define main() \
1020 /* Fake main prototype. */ \
1021 /* void */ _fake_main(); \
1022 /* Real main. */ \
1023 int main() \
1024 { \
1025 _fake_main(); \
1026 return 0; \
1027 } \
1028 /* Fake main definition. */ \
1029 void _fake_main()
1030
1031#define GLSL_CPP_STUBS
1032
1033/* List of reserved keywords in GLSL. */
1034#define common common_is_reserved_glsl_keyword_do_not_use
1035#define partition partition_is_reserved_glsl_keyword_do_not_use
1036#define active active_is_reserved_glsl_keyword_do_not_use
1037#define class class_is_reserved_glsl_keyword_do_not_use
1038#define union union_is_reserved_glsl_keyword_do_not_use
1039// #define enum /* Supported. */
1040#define typedef typedef_is_reserved_glsl_keyword_do_not_use
1041// #define template /* Needed for Stubs. */
1042#define this this_is_reserved_glsl_keyword_do_not_use
1043#define packed packed_is_reserved_glsl_keyword_do_not_use
1044#define resource resource_is_reserved_glsl_keyword_do_not_use
1045#define goto goto_is_reserved_glsl_keyword_do_not_use
1046// #define inline /* Supported. */
1047#define noinline noinline_is_reserved_glsl_keyword_do_not_use
1048#define public public_is_reserved_glsl_keyword_do_not_use
1049// #define static /* Supported. */
1050// #define extern /* Needed for Stubs. */
1051#define external external_is_reserved_glsl_keyword_do_not_use
1052#define interface interface_is_reserved_glsl_keyword_do_not_use
1053#define long long_is_reserved_glsl_keyword_do_not_use
1054// #define short /* Supported. */
1055// #define half /* Supported. */
1056#define fixed fixed_is_reserved_glsl_keyword_do_not_use
1057#define unsigned unsigned_is_reserved_glsl_keyword_do_not_use
1058#define superp superp_is_reserved_glsl_keyword_do_not_use
1059#define input input_is_reserved_glsl_keyword_do_not_use
1060#define output output_is_reserved_glsl_keyword_do_not_use
1061#define hvec2 hvec2_is_reserved_glsl_keyword_do_not_use
1062#define hvec3 hvec3_is_reserved_glsl_keyword_do_not_use
1063#define hvec4 hvec4_is_reserved_glsl_keyword_do_not_use
1064#define fvec2 fvec2_is_reserved_glsl_keyword_do_not_use
1065#define fvec3 fvec3_is_reserved_glsl_keyword_do_not_use
1066#define fvec4 fvec4_is_reserved_glsl_keyword_do_not_use
1067#define sampler3DRect sampler3DRect_is_reserved_glsl_keyword_do_not_use
1068#define filter filter_is_reserved_glsl_keyword_do_not_use
1069#define sizeof sizeof_is_reserved_glsl_keyword_do_not_use
1070#define cast cast_is_reserved_glsl_keyword_do_not_use
1071// #define namespace /* Needed for Stubs. */
1072// #define using /* Needed for Stubs. */
1073#define row_major row_major_is_reserved_glsl_keyword_do_not_use
1074
1076
1077#ifdef __GNUC__
1078/* Avoid warnings caused by our own unroll attributes. */
1079# ifdef __clang__
1080# pragma GCC diagnostic ignored "-Wunknown-attributes"
1081# else
1082# pragma GCC diagnostic ignored "-Wattributes"
1083# endif
1084#endif
unsigned char uchar
unsigned int uint
unsigned short ushort
int32_t bool32_t
#define U
btScalar determinant() const
Return the determinant of the matrix.
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
static T Cube(const T &x)
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
Definition btVector3.h:257
Definition half.h:41
dot(value.rgb, luminance_coefficients)") DEFINE_VALUE("REDUCE(lhs
VecBase< int, D > findMSB(VecOp< int, D >) RET
SamplerBase< uint, 2, true, true > usamplerCubeArray
#define atan
SamplerBase< float, 2, false, true, false, true > sampler2DArrayDepth
#define isnan
int atomicMin(int &, int) RET
ImageBase< uint, 2, true, true > uimage2DArrayAtomic
ImageBase< int, 3, false, true > iimage3DAtomic
SamplerBase< uint, 1 > usamplerBuffer
ImageBase< int, 2 > iimage2D
VecBase< bool, D > notEqual(VecOp< T, D >, VecOp< T, D >) RET
SamplerBase< float, 1, false, true > sampler1DArray
float4 unpackSnorm4x8(uint) RET
#define isinf
ImageBase< uint, 2 > uimage2D
VecBase< int, D > bitfieldExtract(VecOp< int, D >, int, int) RET
ImageBase< int, 2, true, true > iimage2DArrayAtomic
SamplerBase< uint, 2, false, true > usampler2DArray
ImageBase< int, 1, true > iimage1DArray
#define tan
void gpu_discard_fragment()
IMG_TEMPLATE uint imageAtomicXor(T &, IntCoord, uint) RET
#define RESHAPE(mat_to, mat_from,...)
VecBase< bool, D > greaterThanEqual(VecOp< T, D >, VecOp< T, D >) RET
float2 unpackUnorm2x16(uint) RET
SamplerBase< int, 2, true, true > isamplerCubeArray
int2 packed_int2
#define log
#define sin
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
VecBase< int, D > floatBitsToInt(VecOp< float, D >) RET
VecBase< bool, D > lessThanEqual(VecOp< T, D >, VecOp< T, D >) RET
TEX_TEMPLATE DataVec texelFetch(T, IntCoord, int) RET
SamplerBase< uint, 2, false, false, true > usampler2DAtomic
IMG_TEMPLATE DataVec imageLoad(const T &, IntCoord) RET
IMG_TEMPLATE uint imageAtomicMax(T &, IntCoord, uint) RET
ImageBase< uint, 2, false, true > uimage2DAtomic
MatBase< 3, 2 > float3x2
IMG_TEMPLATE uint imageAtomicAdd(T &, IntCoord, uint) RET
VecBase< ushort, 2 > ushort2
#define exp2
#define round
SamplerBase< float, 1 > sampler1D
SamplerBase< int, 3 > isampler3D
SamplerBase< int, 1, false, true > isampler1DArray
T fract(T) RET
ImageBase< float, 1, true > image1DArray
bool any(VecOp< bool, D >) RET
ImageBase< uint, 3, false, true > uimage3DAtomic
SamplerBase< int, 2, false, true > isampler2DArray
VecBase< short, 4 > short4
int atomicMax(int &, int) RET
SamplerBase< uint, 1, false, false, true > usampler1DAtomic
VecBase< short, 2 > short2
VecBase< float, D > intBitsToFloat(VecOp< int, D >) RET
int atomicExchange(int &, int) RET
MatBase< C, R > inverse(MatBase< C, R >) RET
SamplerBase< float, 1 > samplerBuffer
float2 packed_float2
uint packUnorm2x16(float2) RET
VecBase< T, D > refract(VecOp< T, D >, VecOp< T, D >, float) RET
#define pow
#define exp
#define INT_OP
T gpu_dfdx(T) RET
#define acosh
IMG_TEMPLATE uint imageAtomicAnd(T &, IntCoord, uint) RET
VecBase< bool, 4 > bool4
ImageBase< uint, 2, true > uimage2DArray
ImageBase< float, 2, true > image2DArray
int atomicCompSwap(int &, int, int) RET
VecBase< T, D > reflect(VecOp< T, D >, VecOp< T, D >) RET
VecBase< char, 3 > char3
ImageBase< int, 1 > iimage1D
#define cos
VecBase< bool, D > greaterThan(VecOp< T, D >, VecOp< T, D >) RET
TEX_TEMPLATE DataVec textureLod(T, FltCoord, float) RET
#define SWIZZLE_RGBA(T)
SamplerBase< float, 2, true, false, false, true > samplerCubeDepth
SamplerBase< float, 2, true, true > samplerCubeArray
SamplerBase< int, 2 > isampler2D
VecBase< int, D > bitfieldReverse(VecOp< int, D >) RET
VecBase< float, D > normalize(VecOp< float, D >) RET
float4 unpackUnorm4x8(uint) RET
ImageBase< float, 2 > image2D
SamplerBase< float, 3 > sampler3D
VecBase< bool, 3 > bool3
uint packSnorm4x8(float4) RET
#define trunc
T gpu_fwidth(T) RET
uint4 packed_uint4
VecBase< ushort, 3 > ushort3
ImageBase< int, 2, true > iimage2DArray
SamplerBase< int, 2, false, false, true > isampler2DAtomic
#define log2
#define cosh
constexpr T sign(T) RET
VecBase< T, D > faceforward(VecOp< T, D >, VecOp< T, D >, VecOp< T, D >) RET
IMG_TEMPLATE void imageFence(T &)
#define modf
constexpr T inversesqrt(T) RET
int atomicAnd(int &, int) RET
SamplerBase< uint, 2, false, true, true > usampler2DArrayAtomic
TEX_TEMPLATE DataVec textureGrad(T, FltCoord, DerivVec, DerivVec) RET
#define abs
MatBase< 2, 3 > float2x3
SamplerBase< uint, 2, true > usamplerCube
SamplerBase< float, 2, false, false, false, true > sampler2DDepth
ImageBase< float, 3 > image3D
SamplerBase< float, 2, false, true > sampler2DArray
VecBase< half, 2 > half2
ImageBase< float, 1 > image1D
SamplerBase< int, 1 > isamplerBuffer
VecBase< float, D > constexpr mod(VecOp< float, D >, VecOp< float, D >) RET
uint packUnorm4x8(float4) RET
#define floor
#define ceil
int atomicXor(int &, int) RET
IMG_TEMPLATE SizeVec imageSize(const T &) RET
VecBase< uint, D > floatBitsToUint(VecOp< float, D >) RET
IMG_TEMPLATE uint imageAtomicCompSwap(T &, IntCoord, uint, uint) RET
TEX_TEMPLATE DataVec textureLodOffset(T, FltCoord, float, IntCoord) RET
VecBase< int, D > bitfieldInsert(VecOp< int, D >, VecOp< int, D >, int, int) RET
IMG_TEMPLATE uint imageAtomicMin(T &, IntCoord, uint) RET
int atomicAdd(int &, int) RET
ImageBase< uint, 3 > uimage3D
bool all(VecOp< bool, D >) RET
ImageBase< int, 3 > iimage3D
SamplerBase< int, 2, false, true, true > isampler2DArrayAtomic
MatBase< 4, 3 > float4x3
#define SWIZZLE_RGB(T)
MatBase< 3, 3 > float3x3
#define sinh
IMG_TEMPLATE uint imageAtomicExchange(T &, IntCoord, uint) RET
#define sqrt
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
SamplerBase< int, 1 > isampler1D
MatBase< R, C > transpose(MatBase< C, R >) RET
SamplerBase< int, 1, false, false, true > isampler1DAtomic
#define atanh
SamplerBase< uint, 1 > usampler1D
#define ldexp
ImageBase< int, 2, false, true > iimage2DAtomic
VecBase< int, D > bitCount(VecOp< int, D >) RET
float4 packed_float4
T gpu_dfdy(T) RET
VecBase< float, D > uintBitsToFloat(VecOp< uint, D >) RET
SamplerBase< float, 2 > sampler2D
#define asin
VecBase< char, 2 > char2
VecBase< short, 3 > short3
SamplerBase< uint, 3 > usampler3D
#define IMG_TEMPLATE
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
VecBase< bool, D > lessThan(VecOp< T, D >, VecOp< T, D >) RET
#define RET
VecBase< half, 3 > half3
float2 unpackHalf2x16(uint) RET
constexpr T radians(T) RET
IMG_TEMPLATE uint imageAtomicOr(T &, IntCoord, uint) RET
#define frexp
uint packHalf2x16(float2) RET
SamplerBase< int, 2, true > isamplerCube
ImageBase< uint, 1, true > uimage1DArray
VecBase< bool, D > equal(VecOp< T, D >, VecOp< T, D >) RET
ImageBase< uint, 1 > uimage1D
VecBase< bool, 2 > bool2
float2 unpackSnorm2x16(uint) RET
TEX_TEMPLATE SizeVec textureSize(T, int) RET
TEX_TEMPLATE DataVec texelFetchOffset(T, IntCoord, int, IntCoord) RET
#define TEX_TEMPLATE
#define tanh
SamplerBase< float, 2, true > samplerCube
SamplerBase< uint, 3, false, false, true > usampler3DAtomic
constexpr T clamp(T, U, U) RET
int4 packed_int4
#define acos
VecBase< int, D > findLSB(VecOp< int, D >) RET
SamplerBase< uint, 1, false, true > usampler1DArray
#define SWIZZLE_XYZW(T)
uint2 packed_uint2
SamplerBase< uint, 2 > usampler2D
SamplerBase< float, 2, true, true, false, true > samplerCubeArrayDepth
uint packSnorm2x16(float2) RET
SamplerBase< int, 3, false, false, true > isampler3DAtomic
#define SWIZZLE_XYZ(T)
VecBase< char, 4 > char4
#define fma
float distance(VecOp< float, D >, VecOp< float, D >) RET
int atomicOr(int &, int) RET
constexpr T degrees(T) RET
#define SWIZZLE_RG(T)
#define STD_OP
TEX_TEMPLATE DataVec textureGather(T, FltCoord) RET
#define SWIZZLE_XY(T)
VecBase< bool, D > operator!(VecOp< bool, D >) RET
IMG_TEMPLATE void imageStore(T &, IntCoord, DataVec)
#define asinh
#define mix(a, b, c)
Definition hash.h:35
MINLINE float smoothstep(float edge0, float edge1, float x)
#define T
#define R
MatBase< float, 2, 2 > float2x2
VecBase< uint32_t, 3 > uint3
MatBase< float, 4, 4 > float4x4
MatBase< float, 2, 4 > float2x4
MatBase< float, 3, 4 > float3x4
VecBase< float, 4 > float4
VecBase< float, 2 > float2
MatBase< float, 4, 2 > float4x2
const uint3 gl_GlobalInvocationID
const uint gl_LocalInvocationIndex
constexpr uint3 gl_WorkGroupSize
const uint3 gl_NumWorkGroups
const uint3 gl_WorkGroupID
const uint3 gl_LocalInvocationID
const float4 gl_FragCoord
const float gl_ClipDistance[6]
const int gpu_BaseInstance
const int gpu_InstanceIndex
const int gl_InstanceID
const int gl_BaseVertex
const int gl_VertexID
#define min(a, b)
Definition sort.cc:36
VecBase< int, coord_dim > int_coord_type
VecBase< T, 4 > data_vec_type
VecBase< int, coord_dim > size_vec_type
static constexpr int coord_dim
MatBase(const MatBase< OtherC, OtherR > &)
VecBase< float, R > ColT
MatBase()=default
VecBase< float, R > ColT
MatBase()=default
MatBase(T, T, T, T, T, T, T, T, T)
MatBase(ColT, ColT, ColT)
MatBase(const MatBase< OtherC, OtherR > &)
MatBase(ColT, ColT, ColT, ColT)
VecBase< float, R > ColT
MatBase(T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T)
MatBase(const MatBase< OtherC, OtherR > &)
MatBase()=default
ColT & operator[](int)
VecBase< float, C > RowT
MatBase< C, R > MatT
VecBase< float, R > ColT
const ColT & operator[](int) const
MatT operator+() RET
VecBase< float, coord_dim > flt_coord_type
static constexpr int coord_dim
VecBase< int, extent_dim > size_vec_type
static constexpr int deriv_dim
VecBase< int, coord_dim > int_coord_type
VecBase< float, deriv_dim > derivative_type
static constexpr int extent_dim
VecBase< T, 4 > data_vec_type
constexpr VecT operator=(const VecT &) RET
SwizzleBase()=default
VecBase< T, Sz > VecT
VecBase()=default
VecBase(VecOp< U, 1 >)
VecBase(VecOp< U, 2 >)
VecBase()=default
constexpr VecBase(T x_, T y_)
constexpr VecBase(T, VecOp< T, 2 >)
constexpr VecBase(T x_, T y_, T z_)
VecBase()=default
constexpr VecBase(VecOp< T, 2 >, T)
VecBase(VecOp< U, 3 >)
constexpr VecBase(VecOp< T, 3 >, T)
VecBase(VecOp< U, 4 >)
constexpr VecBase(T x_, T y_, T z_, T w_)
constexpr VecBase(VecOp< T, 2 >, T, T)
VecBase()=default
constexpr VecBase(T, T, VecOp< T, 2 >)
constexpr VecBase(T, VecOp< T, 2 >, T)
constexpr VecBase(T, VecOp< T, 3 >)
constexpr VecBase(VecOp< T, 2 >, VecOp< T, 2 >)
VecBase(VecOp< float, 2 >)
VecBase(VecOp< bool, 2 >, bool)
VecBase(bool, bool, bool)
VecBase(bool, VecOp< bool, 2 >)
VecBase(bool, bool, VecOp< bool, 2 >)
VecBase(bool, VecOp< bool, 2 >, bool)
VecBase(VecOp< bool, 2 >, VecOp< bool, 2 >)
VecBase(bool, VecOp< bool, 3 >)
VecBase(VecOp< bool, 3 >, bool)
VecBase(bool, bool, bool, bool)
VecBase(VecOp< bool, 2 >, bool, bool)
INT_OP friend VecT operator>>(VecT, VecT) RET
T & operator[](int)
INT_OP friend VecT operator<<(VecT, VecT) RET
INT_OP friend VecT operator^(VecT, VecT) RET
INT_OP friend VecT operator&(VecT, T) RET
INT_OP friend VecT operator&=(VecT, T) RET
INT_OP friend VecT operator<<=(VecT, VecT) RET
INT_OP friend VecT operator|=(VecT, T) RET
INT_OP friend VecT operator&(VecT, VecT) RET
INT_OP friend VecT operator%=(VecT, VecT) RET
INT_OP friend VecT operator>>=(VecT, VecT) RET
INT_OP friend VecT operator>>=(T, VecT) RET
INT_OP friend VecT operator<<=(VecT, T) RET
INT_OP friend VecT operator^=(VecT, VecT) RET
VecBase< T, Sz > VecT
INT_OP friend VecT operator<<(T, VecT) RET
INT_OP friend VecT operator^(T, VecT) RET
INT_OP friend VecT operator%(VecT, VecT) RET
INT_OP friend VecT operator>>(T, VecT) RET
INT_OP friend VecT operator<<(VecT, T) RET
INT_OP friend VecT operator|(T, VecT) RET
INT_OP friend VecT operator^(VecT, T) RET
STD_OP VecT operator+() const RET
INT_OP friend VecT operator&(T, VecT) RET
INT_OP friend VecT operator|(VecT, T) RET
INT_OP friend VecT operator|(VecT, VecT) RET
INT_OP friend VecT operator|=(VecT, VecT) RET
const T & operator[](int) const
INT_OP friend VecT operator^=(VecT, T) RET
INT_OP friend VecT operator>>(VecT, T) RET
INT_OP friend VecT operator%(VecT, T) RET
INT_OP friend VecT operator%(T, VecT) RET
INT_OP friend VecT operator&=(VecT, VecT) RET
INT_OP friend VecT operator~(VecT) RET
INT_OP friend VecT operator>>=(VecT, T) RET
INT_OP friend VecT operator<<=(T, VecT) RET
INT_OP friend VecT operator%=(VecT, T) RET
Definition half.h:60
max
Definition text_draw.cc:251
int xy[2]
Definition wm_draw.cc:174