3 // This file defines nearly all constructors and operators for built-in data types, using
4 // extended language syntax. In general, compiler treats constructors and operators as
5 // ordinary functions with some exceptions. For example, the language does not allow
6 // functions to be called in constant expressions - here the exception is made to allow it.
8 // Each implementation provides its own version of this file. Each implementation can define
9 // the required set of operators and constructors in its own fashion.
11 // The extended language syntax is only present when compiling this file. It is implicitly
12 // included at the very beginning of the compiled shader, so no built-in functions can be
15 // To communicate with the implementation, a special extended "__asm" keyword is used, followed
16 // by an instruction name (any valid identifier), a destination variable identifier and a
17 // a list of zero or more source variable identifiers. A variable identifier is a variable name
18 // declared earlier in the code (as a function parameter, local or global variable).
19 // An instruction name designates an instruction that must be exported by the implementation.
20 // Each instruction receives data from source variable identifiers and returns data in the
21 // destination variable identifier.
23 // It is up to the implementation how to define a particular operator or constructor. If it is
24 // expected to being used rarely, it can be defined in terms of other operators and constructors,
27 // ivec2 __operator + (const ivec2 x, const ivec2 y) {
28 // return ivec2 (x[0] + y[0], x[1] + y[1]);
31 // If a particular operator or constructor is expected to be used very often or is an atomic
32 // operation (that is, an operation that cannot be expressed in terms of other operations or
33 // would create a dependency cycle) it must be defined using one or more __asm constructs.
35 // Each implementation must define constructors for all scalar types (bool, float, int).
36 // There are 9 scalar-to-scalar constructors (including identity constructors). However,
37 // since the language introduces special constructors (like matrix constructor with a single
38 // scalar value), implementations must also implement these cases.
39 // The compiler provides the following algorithm when resolving a constructor:
40 // - try to find a constructor with a prototype matching ours,
41 // - if no constructor is found and this is a scalar-to-scalar constructor, raise an error,
42 // - if a constructor is found, execute it and return,
43 // - count the size of the constructor parameter list - if it is less than the size of
44 // our constructor's type, raise an error,
45 // - for each parameter in the list do a recursive constructor matching for appropriate
46 // scalar fields in the constructed variable,
48 // Each implementation must also define a set of operators that deal with built-in data types.
49 // There are four kinds of operators:
50 // 1) Operators that are implemented only by the compiler: "()" (function call), "," (sequence)
51 // and "?:" (selection).
52 // 2) Operators that are implemented by the compiler by expressing it in terms of other operators:
53 // - "." (field selection) - translated to subscript access,
54 // - "&&" (logical and) - translated to "<left_expr> ? <right_expr> : false",
55 // - "||" (logical or) - translated to "<left_expr> ? true : <right_expr>",
56 // 3) Operators that can be defined by the implementation and if the required prototype is not
57 // found, standard behaviour is used:
58 // - "==", "!=", "=" (equality, assignment) - compare or assign matching fields one-by-one;
59 // note that at least operators for scalar data types must be defined by the implementation
61 // 4) All other operators not mentioned above. If no required prototype is found, an error is
62 // raised. An implementation must follow the language specification to provide all valid
63 // operator prototypes.
66 int __constructor (const float f) {
68 __asm float_to_int i, f;
72 bool __constructor (const int i) {
76 bool __constructor (const float f) {
80 int __constructor (const bool b) {
84 float __constructor (const bool b) {
88 float __constructor (const int i) {
90 __asm int_to_float f, i;
94 bool __constructor (const bool b) {
98 int __constructor (const int i) {
102 float __constructor (const float f) {
106 vec2 __constructor (const float f) {
113 vec2 __constructor (const int i) {
115 __asm int_to_float x, i;
119 vec2 __constructor (const bool b) {
120 return vec2 (b ? 1.0 : 0.0);
123 vec3 __constructor (const float f) {
131 vec3 __constructor (const int i) {
133 __asm int_to_float x, i;
137 vec3 __constructor (const bool b) {
138 return vec3 (b ? 1.0 : 0.0);
141 vec4 __constructor (const float f) {
150 vec4 __constructor (const int i) {
152 __asm int_to_float x, i;
156 vec4 __constructor (const bool b) {
157 return vec4 (b ? 1.0 : 0.0);
160 ivec2 __constructor (const int i) {
167 ivec2 __constructor (const float f) {
168 return ivec2 (int (f));
171 ivec2 __constructor (const bool b) {
172 return ivec2 (int (b));
175 ivec3 __constructor (const int i) {
183 ivec3 __constructor (const float f) {
184 return ivec3 (int (f));
187 ivec3 __constructor (const bool b) {
188 return ivec3 (int (b));
191 ivec4 __constructor (const int i) {
200 ivec4 __constructor (const float f) {
201 return ivec4 (int (f));
204 ivec4 __constructor (const bool b) {
205 return ivec4 (int (b));
208 bvec2 __constructor (const bool b) {
215 bvec2 __constructor (const float f) {
216 return bvec2 (bool (f));
219 bvec2 __constructor (const int i) {
220 return bvec2 (bool (i));
223 bvec3 __constructor (const bool b) {
231 bvec3 __constructor (const float f) {
232 return bvec3 (bool (f));
235 bvec3 __constructor (const int i) {
236 return bvec3 (bool (i));
239 bvec4 __constructor (const bool b) {
248 bvec4 __constructor (const float f) {
249 return bvec4 (bool (f));
252 bvec4 __constructor (const int i) {
253 return bvec4 (bool (i));
256 mat2 __constructor (const float f) {
265 mat2 __constructor (const int i) {
267 __asm int_to_float x, i;
271 mat2 __constructor (const bool b) {
272 return mat2 (b ? 1.0 : 0.0);
275 mat3 __constructor (const float f) {
289 mat3 __constructor (const int i) {
291 __asm int_to_float x, i;
295 mat3 __constructor (const bool b) {
296 return mat3 (b ? 1.0 : 0.0);
299 mat4 __constructor (const float f) {
320 mat4 __constructor (const int i) {
322 __asm int_to_float x, i;
326 mat4 __constructor (const bool b) {
327 return mat4 (b ? 1.0 : 0.0);
330 void __operator += (inout float a, const float b) {
331 __asm float_add a, a, b;
334 float __operator - (const float a) {
336 __asm float_negate b, a;
340 void __operator -= (inout float a, const float b) {
342 __asm float_negate c, b;
343 __asm float_add a, a, c;
346 void __operator *= (inout float a, const float b) {
347 __asm float_multiply a, a, b;
350 void __operator /= (inout float a, const float b) {
351 __asm float_divide a, a, b;
354 float __operator + (const float a, const float b) {
356 __asm float_add c, a, b;
360 void __operator += (inout int a, const int b) {
361 a = int (float (a) + float (b));
364 int __operator - (const int a) {
367 __asm int_to_float x, a;
368 __asm float_negate x, x;
369 __asm float_to_int b, x;
373 void __operator -= (inout int a, const int b) {
377 float __operator * (const float a, const float b) {
379 __asm float_multiply c, a, b;
383 void __operator *= (inout int a, const int b) {
384 a = int (float (a) * float (b));
387 float __operator / (const float a, const float b) {
389 __asm float_divide c, a, b;
393 void __operator /= (inout int a, const int b) {
394 a = int (float (a) / float (b));
397 void __operator += (inout vec2 v, const vec2 u) {
402 void __operator -= (inout vec2 v, const vec2 u) {
407 void __operator *= (inout vec2 v, const vec2 u) {
412 void __operator /= (inout vec2 v, const vec2 u) {
417 void __operator += (inout vec3 v, const vec3 u) {
423 void __operator -= (inout vec3 v, const vec3 u) {
429 void __operator *= (inout vec3 v, const vec3 u) {
435 void __operator /= (inout vec3 v, const vec3 u) {
441 void __operator += (inout vec4 v, const vec4 u) {
448 void __operator -= (inout vec4 v, const vec4 u) {
455 void __operator *= (inout vec4 v, const vec4 u) {
462 void __operator /= (inout vec4 v, const vec4 u) {
469 void __operator += (inout ivec2 v, const ivec2 u) {
474 void __operator -= (inout ivec2 v, const ivec2 u) {
479 void __operator *= (inout ivec2 v, const ivec2 u) {
484 void __operator /= (inout ivec2 v, const ivec2 u) {
489 void __operator += (inout ivec3 v, const ivec3 u) {
495 void __operator -= (inout ivec3 v, const ivec3 u) {
501 void __operator *= (inout ivec3 v, const ivec3 u) {
507 void __operator /= (inout ivec3 v, const ivec3 u) {
513 void __operator += (inout ivec4 v, const ivec4 u) {
520 void __operator -= (inout ivec4 v, const ivec4 u) {
527 void __operator *= (inout ivec4 v, const ivec4 u) {
534 void __operator /= (inout ivec4 v, const ivec4 u) {
541 void __operator += (inout mat2 m, const mat2 n) {
546 void __operator -= (inout mat2 m, const mat2 n) {
551 vec2 __operator * (const mat2 m, const vec2 v) {
553 u.x = v.x * m[0].x + v.y * m[1].x;
554 u.y = v.x * m[0].y + v.y * m[1].y;
558 mat2 __operator * (const mat2 m, const mat2 n) {
565 void __operator *= (inout mat2 m, const mat2 n) {
569 void __operator /= (inout mat2 m, const mat2 n) {
574 void __operator += (inout mat3 m, const mat3 n) {
580 void __operator -= (inout mat3 m, const mat3 n) {
586 vec3 __operator * (const mat3 m, const vec3 v) {
588 u.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x;
589 u.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y;
590 u.z = v.x * m[0].z + v.y * m[1].z + v.z * m[2].z;
594 mat3 __operator * (const mat3 m, const mat3 n) {
602 void __operator *= (inout mat3 m, const mat3 n) {
606 void __operator /= (inout mat3 m, const mat3 n) {
612 void __operator += (inout mat4 m, const mat4 n) {
619 void __operator -= (inout mat4 m, const mat4 n) {
626 vec4 __operator * (const mat4 m, const vec4 v) {
628 u.x = v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x;
629 u.y = v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y;
630 u.z = v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z;
631 u.w = v.x * m[0].w + v.y * m[1].w + v.z * m[2].w + v.w * m[3].w;
635 mat4 __operator * (const mat4 m, const mat4 n) {
644 void __operator *= (inout mat4 m, const mat4 n) {
648 void __operator /= (inout mat4 m, const mat4 n) {
655 void __operator += (inout vec2 v, const float a) {
660 void __operator -= (inout vec2 v, const float a) {
665 void __operator *= (inout vec2 v, const float a) {
670 void __operator /= (inout vec2 v, const float a) {
675 void __operator += (inout vec3 v, const float a) {
681 void __operator -= (inout vec3 v, const float a) {
687 void __operator *= (inout vec3 v, const float a) {
693 void __operator /= (inout vec3 v, const float a) {
699 void __operator += (inout vec4 v, const float a) {
706 void __operator -= (inout vec4 v, const float a) {
713 void __operator *= (inout vec4 v, const float a) {
720 void __operator /= (inout vec4 v, const float a) {
727 void __operator += (inout mat2 m, const float a) {
732 void __operator -= (inout mat2 m, const float a) {
737 void __operator *= (inout mat2 m, const float a) {
742 void __operator /= (inout mat2 m, const float a) {
747 void __operator += (inout mat3 m, const float a) {
753 void __operator -= (inout mat3 m, const float a) {
759 void __operator *= (inout mat3 m, const float a) {
765 void __operator /= (inout mat3 m, const float a) {
771 void __operator += (inout mat4 m, const float a) {
778 void __operator -= (inout mat4 m, const float a) {
785 void __operator *= (inout mat4 m, const float a) {
792 void __operator /= (inout mat4 m, const float a) {
799 vec2 __operator * (const vec2 v, const mat2 m) {
801 u.x = v.x * m[0].x + v.y * m[0].y;
802 u.y = v.x * m[1].x + v.y * m[1].y;
806 void __operator *= (inout vec2 v, const mat2 m) {
810 vec3 __operator * (const vec3 v, const mat3 m) {
812 u.x = v.x * m[0].x + v.y * m[0].y + v.z * m[0].z;
813 u.y = v.x * m[1].x + v.y * m[1].y + v.z * m[1].z;
814 u.z = v.x * m[2].x + v.y * m[2].y + v.z * m[2].z;
818 void __operator *= (inout vec3 v, const mat3 m) {
822 vec4 __operator * (const vec4 v, const mat4 m) {
824 u.x = v.x * m[0].x + v.y * m[0].y + v.z * m[0].z + v.w * m[0].w;
825 u.y = v.x * m[1].x + v.y * m[1].y + v.z * m[1].z + v.w * m[1].w;
826 u.z = v.x * m[2].x + v.y * m[2].y + v.z * m[2].z + v.w * m[2].w;
827 u.w = v.x * m[3].x + v.y * m[3].y + v.z * m[3].z + v.w * m[3].w;
831 void __operator *= (inout vec4 v, const mat4 m) {
835 float __operator - (const float a, const float b) {
837 __asm float_negate c, b;
838 __asm float_add c, a, c;
842 int __operator + (const int a, const int b) {
845 __asm int_to_float x, a;
846 __asm int_to_float y, b;
847 __asm float_add x, x, y;
848 __asm float_to_int c, x;
852 int __operator - (const int a, const int b) {
855 __asm int_to_float x, a;
856 __asm int_to_float y, b;
857 __asm float_negate y, y;
858 __asm float_add x, x, y;
859 __asm float_to_int c, x;
863 int __operator * (const int a, const int b) {
866 __asm int_to_float x, a;
867 __asm int_to_float y, b;
868 __asm float_multiply x, x, y;
869 __asm float_to_int c, x;
873 int __operator / (const int a, const int b) {
876 __asm int_to_float x, a;
877 __asm int_to_float y, b;
878 __asm float_divide x, x, y;
879 __asm float_to_int c, x;
883 vec2 __operator + (const vec2 v, const vec2 u) {
890 vec2 __operator - (const vec2 v, const vec2 u) {
897 vec2 __operator * (const vec2 v, const vec2 u) {
904 vec2 __operator / (const vec2 v, const vec2 u) {
911 vec3 __operator + (const vec3 v, const vec3 u) {
919 vec3 __operator - (const vec3 v, const vec3 u) {
927 vec3 __operator * (const vec3 v, const vec3 u) {
935 vec3 __operator / (const vec3 v, const vec3 u) {
943 vec4 __operator + (const vec4 v, const vec4 u) {
952 vec4 __operator - (const vec4 v, const vec4 u) {
961 vec4 __operator * (const vec4 v, const vec4 u) {
970 vec4 __operator / (const vec4 v, const vec4 u) {
979 ivec2 __operator + (const ivec2 v, const ivec2 u) {
986 ivec2 __operator - (const ivec2 v, const ivec2 u) {
993 ivec2 __operator * (const ivec2 v, const ivec2 u) {
1000 ivec2 __operator / (const ivec2 v, const ivec2 u) {
1007 ivec3 __operator + (const ivec3 v, const ivec3 u) {
1015 ivec3 __operator - (const ivec3 v, const ivec3 u) {
1023 ivec3 __operator * (const ivec3 v, const ivec3 u) {
1031 ivec3 __operator / (const ivec3 v, const ivec3 u) {
1039 ivec4 __operator + (const ivec4 v, const ivec4 u) {
1048 ivec4 __operator - (const ivec4 v, const ivec4 u) {
1057 ivec4 __operator * (const ivec4 v, const ivec4 u) {
1066 ivec4 __operator / (const ivec4 v, const ivec4 u) {
1075 mat2 __operator + (const mat2 m, const mat2 n) {
1082 mat2 __operator - (const mat2 m, const mat2 n) {
1089 mat2 __operator / (const mat2 m, const mat2 n) {
1096 mat3 __operator + (const mat3 m, const mat3 n) {
1104 mat3 __operator - (const mat3 m, const mat3 n) {
1112 mat3 __operator / (const mat3 m, const mat3 n) {
1120 mat4 __operator + (const mat4 m, const mat4 n) {
1129 mat4 __operator - (const mat4 m, const mat4 n) {
1138 mat4 __operator / (const mat4 m, const mat4 n) {
1147 vec2 __operator + (const float a, const vec2 u) {
1154 vec2 __operator + (const vec2 v, const float b) {
1161 vec2 __operator - (const float a, const vec2 u) {
1168 vec2 __operator - (const vec2 v, const float b) {
1175 vec2 __operator * (const float a, const vec2 u) {
1182 vec2 __operator * (const vec2 v, const float b) {
1189 vec2 __operator / (const float a, const vec2 u) {
1196 vec2 __operator / (const vec2 v, const float b) {
1203 vec3 __operator + (const float a, const vec3 u) {
1211 vec3 __operator + (const vec3 v, const float b) {
1219 vec3 __operator - (const float a, const vec3 u) {
1227 vec3 __operator - (const vec3 v, const float b) {
1235 vec3 __operator * (const float a, const vec3 u) {
1243 vec3 __operator * (const vec3 v, const float b) {
1251 vec3 __operator / (const float a, const vec3 u) {
1259 vec3 __operator / (const vec3 v, const float b) {
1267 vec4 __operator + (const float a, const vec4 u) {
1276 vec4 __operator + (const vec4 v, const float b) {
1285 vec4 __operator - (const float a, const vec4 u) {
1294 vec4 __operator - (const vec4 v, const float b) {
1303 vec4 __operator * (const float a, const vec4 u) {
1312 vec4 __operator * (const vec4 v, const float b) {
1321 vec4 __operator / (const float a, const vec4 u) {
1330 vec4 __operator / (const vec4 v, const float b) {
1339 mat2 __operator + (const float a, const mat2 n) {
1346 mat2 __operator + (const mat2 m, const float b) {
1353 mat2 __operator - (const float a, const mat2 n) {
1360 mat2 __operator - (const mat2 m, const float b) {
1367 mat2 __operator * (const float a, const mat2 n) {
1374 mat2 __operator * (const mat2 m, const float b) {
1381 mat2 __operator / (const float a, const mat2 n) {
1388 mat2 __operator / (const mat2 m, const float b) {
1395 mat3 __operator + (const float a, const mat3 n) {
1403 mat3 __operator + (const mat3 m, const float b) {
1411 mat3 __operator - (const float a, const mat3 n) {
1419 mat3 __operator - (const mat3 m, const float b) {
1427 mat3 __operator * (const float a, const mat3 n) {
1435 mat3 __operator * (const mat3 m, const float b) {
1443 mat3 __operator / (const float a, const mat3 n) {
1451 mat3 __operator / (const mat3 m, const float b) {
1459 mat4 __operator + (const float a, const mat4 n) {
1468 mat4 __operator + (const mat4 m, const float b) {
1477 mat4 __operator - (const float a, const mat4 n) {
1486 mat4 __operator - (const mat4 m, const float b) {
1495 mat4 __operator * (const float a, const mat4 n) {
1504 mat4 __operator * (const mat4 m, const float b) {
1513 mat4 __operator / (const float a, const mat4 n) {
1522 mat4 __operator / (const mat4 m, const float b) {
1531 ivec2 __operator + (const int a, const ivec2 u) {
1532 return ivec2 (a) + u;
1535 ivec2 __operator + (const ivec2 v, const int b) {
1536 return v + ivec2 (b);
1539 ivec2 __operator - (const int a, const ivec2 u) {
1540 return ivec2 (a) - u;
1543 ivec2 __operator - (const ivec2 v, const int b) {
1544 return v - ivec2 (b);
1547 ivec2 __operator * (const int a, const ivec2 u) {
1548 return ivec2 (a) * u;
1551 ivec2 __operator * (const ivec2 v, const int b) {
1552 return v * ivec2 (b);
1555 ivec2 __operator / (const int a, const ivec2 u) {
1556 return ivec2 (a) / u;
1559 ivec2 __operator / (const ivec2 v, const int b) {
1560 return v / ivec2 (b);
1563 ivec3 __operator + (const int a, const ivec3 u) {
1564 return ivec3 (a) + u;
1567 ivec3 __operator + (const ivec3 v, const int b) {
1568 return v + ivec3 (b);
1571 ivec3 __operator - (const int a, const ivec3 u) {
1572 return ivec3 (a) - u;
1575 ivec3 __operator - (const ivec3 v, const int b) {
1576 return v - ivec3 (b);
1579 ivec3 __operator * (const int a, const ivec3 u) {
1580 return ivec3 (a) * u;
1583 ivec3 __operator * (const ivec3 v, const int b) {
1584 return v * ivec3 (b);
1587 ivec3 __operator / (const int a, const ivec3 u) {
1588 return ivec3 (a) / u;
1591 ivec3 __operator / (const ivec3 v, const int b) {
1592 return v / ivec3 (b);
1595 ivec4 __operator + (const int a, const ivec4 u) {
1596 return ivec4 (a) + u;
1599 ivec4 __operator + (const ivec4 v, const int b) {
1600 return v + ivec4 (b);
1603 ivec4 __operator - (const int a, const ivec4 u) {
1604 return ivec4 (a) - u;
1607 ivec4 __operator - (const ivec4 v, const int b) {
1608 return v - ivec4 (b);
1611 ivec4 __operator * (const int a, const ivec4 u) {
1612 return ivec4 (a) * u;
1615 ivec4 __operator * (const ivec4 v, const int b) {
1616 return v * ivec4 (b);
1619 ivec4 __operator / (const int a, const ivec4 u) {
1620 return ivec4 (a) / u;
1623 ivec4 __operator / (const ivec4 v, const int b) {
1624 return v / ivec4 (b);
1627 vec2 __operator - (const vec2 v) {
1634 vec3 __operator - (const vec3 v) {
1642 vec4 __operator - (const vec4 v) {
1651 ivec2 __operator - (const ivec2 v) {
1658 ivec3 __operator - (const ivec3 v) {
1666 ivec4 __operator - (const ivec4 v) {
1675 mat2 __operator - (const mat2 m) {
1682 mat3 __operator - (const mat3 m) {
1690 mat4 __operator - (const mat4 m) {
1699 void __operator -- (inout float a) {
1703 void __operator -- (inout int a) {
1707 void __operator -- (inout vec2 v) {
1712 void __operator -- (inout vec3 v) {
1718 void __operator -- (inout vec4 v) {
1725 void __operator -- (inout ivec2 v) {
1730 void __operator -- (inout ivec3 v) {
1736 void __operator -- (inout ivec4 v) {
1743 void __operator -- (inout mat2 m) {
1748 void __operator -- (inout mat3 m) {
1754 void __operator -- (inout mat4 m) {
1761 void __operator ++ (inout float a) {
1765 void __operator ++ (inout int a) {
1769 void __operator ++ (inout vec2 v) {
1774 void __operator ++ (inout vec3 v) {
1780 void __operator ++ (inout vec4 v) {
1787 void __operator ++ (inout ivec2 v) {
1792 void __operator ++ (inout ivec3 v) {
1798 void __operator ++ (inout ivec4 v) {
1805 void __operator ++ (inout mat2 m) {
1810 void __operator ++ (inout mat3 m) {
1816 void __operator ++ (inout mat4 m) {
1824 // NOTE: postfix increment and decrement operators take additional dummy int parameter to
1825 // distinguish their prototypes from prefix ones.
1828 float __operator -- (inout float a, const int) {
1835 int __operator -- (inout int a, const int) {
1842 vec2 __operator -- (inout vec2 v, const int) {
1850 vec3 __operator -- (inout vec3 v, const int) {
1859 vec4 __operator -- (inout vec4 v, const int) {
1869 ivec2 __operator -- (inout ivec2 v, const int) {
1877 ivec3 __operator -- (inout ivec3 v, const int) {
1886 ivec4 __operator -- (inout ivec4 v, const int) {
1896 mat2 __operator -- (inout mat2 m, const int) {
1904 mat3 __operator -- (inout mat3 m, const int) {
1913 mat4 __operator -- (inout mat4 m, const int) {
1923 float __operator ++ (inout float a, const int) {
1930 int __operator ++ (inout int a, const int) {
1937 vec2 __operator ++ (inout vec2 v, const int) {
1945 vec3 __operator ++ (inout vec3 v, const int) {
1954 vec4 __operator ++ (inout vec4 v, const int) {
1964 ivec2 __operator ++ (inout ivec2 v, const int) {
1972 ivec3 __operator ++ (inout ivec3 v, const int) {
1981 ivec4 __operator ++ (inout ivec4 v, const int) {
1991 mat2 __operator ++ (inout mat2 m, const int) {
1999 mat3 __operator ++ (inout mat3 m, const int) {
2008 mat4 __operator ++ (inout mat4 m, const int) {
2018 bool __operator < (const float a, const float b) {
2020 __asm float_less c, a, b;
2024 bool __operator < (const int a, const int b) {
2025 return float (a) < float (b);
2028 bool __operator > (const float a, const float b) {
2030 __asm float_less c, b, a;
2034 bool __operator > (const int a, const int b) {
2035 return float (a) > float (b);
2038 bool __operator >= (const float a, const float b) {
2040 __asm float_less g, b, a;
2041 __asm float_equal e, a, b;
2045 bool __operator >= (const int a, const int b) {
2046 return float (a) >= float (b);
2049 bool __operator <= (const float a, const float b) {
2051 __asm float_less g, a, b;
2052 __asm float_equal e, a, b;
2056 bool __operator <= (const int a, const int b) {
2057 return float (a) <= float (b);
2060 bool __operator ^^ (const bool a, const bool b) {
2065 // These operators are handled internally by the compiler:
2067 // bool __operator && (bool a, bool b) {
2068 // return a ? b : false;
2070 // bool __operator || (bool a, bool b) {
2071 // return a ? true : b;
2075 bool __operator ! (const bool a) {
2080 // mesa-specific extension functions.
2083 void print (const float f) {
2084 __asm float_print f;
2087 void print (const int i) {
2091 void print (const bool b) {
2095 void print (const vec2 v) {
2100 void print (const vec3 v) {
2106 void print (const vec4 v) {
2113 void print (const ivec2 v) {
2118 void print (const ivec3 v) {
2124 void print (const ivec4 v) {
2131 void print (const bvec2 v) {
2136 void print (const bvec3 v) {
2142 void print (const bvec4 v) {
2149 void print (const mat2 m) {
2154 void print (const mat3 m) {
2160 void print (const mat4 m) {
2167 void print (const sampler1D e) {
2171 void print (const sampler2D e) {
2175 void print (const sampler3D e) {
2179 void print (const samplerCube e) {
2183 void print (const sampler1DShadow e) {
2187 void print (const sampler2DShadow e) {