More GLSL code:
[mesa.git] / src / mesa / shader / slang / library / slang_core.gc
1
2 //
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.
7 //
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.
10 //
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
13 // used.
14 //
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.
22 //
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,
25 // for example:
26 //
27 // ivec2 __operator + (const ivec2 x, const ivec2 y) {
28 // return ivec2 (x[0] + y[0], x[1] + y[1]);
29 // }
30 //
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.
34 //
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,
47 //
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
60 // to get it work,
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.
64 //
65
66 int __constructor (const float f) {
67 int i;
68 __asm float_to_int i, f;
69 return i;
70 }
71
72 bool __constructor (const int i) {
73 return i != 0;
74 }
75
76 bool __constructor (const float f) {
77 return f != 0.0;
78 }
79
80 int __constructor (const bool b) {
81 return b ? 1 : 0;
82 }
83
84 float __constructor (const bool b) {
85 return b ? 1.0 : 0.0;
86 }
87
88 float __constructor (const int i) {
89 float f;
90 __asm int_to_float f, i;
91 return f;
92 }
93
94 bool __constructor (const bool b) {
95 return b;
96 }
97
98 int __constructor (const int i) {
99 return i;
100 }
101
102 float __constructor (const float f) {
103 return f;
104 }
105
106 vec2 __constructor (const float f) {
107 return vec2 (f, f);
108 }
109
110 vec2 __constructor (const int i) {
111 float x;
112 __asm int_to_float x, i;
113 return vec2 (x);
114 }
115
116 vec2 __constructor (const bool b) {
117 return vec2 (b ? 1.0 : 0.0);
118 }
119
120 vec3 __constructor (const float f) {
121 return vec3 (f, f, f);
122 }
123
124 vec3 __constructor (const int i) {
125 float x;
126 __asm int_to_float x, i;
127 return vec3 (x);
128 }
129
130 vec3 __constructor (const bool b) {
131 return vec3 (b ? 1.0 : 0.0);
132 }
133
134 vec4 __constructor (const float f) {
135 return vec4 (f, f, f, f);
136 }
137
138 vec4 __constructor (const int i) {
139 float x;
140 __asm int_to_float x, i;
141 return vec4 (x);
142 }
143
144 vec4 __constructor (const bool b) {
145 return vec4 (b ? 1.0 : 0.0);
146 }
147
148 ivec2 __constructor (const int i) {
149 return ivec2 (i, i);
150 }
151
152 ivec2 __constructor (const float f) {
153 return ivec2 (int (f));
154 }
155
156 ivec2 __constructor (const bool b) {
157 return ivec2 (int (b));
158 }
159
160 ivec3 __constructor (const int i) {
161 return ivec3 (i, i, i);
162 }
163
164 ivec3 __constructor (const float f) {
165 return ivec3 (int (f));
166 }
167
168 ivec3 __constructor (const bool b) {
169 return ivec3 (int (b));
170 }
171
172 ivec4 __constructor (const int i) {
173 return ivec4 (i, i, i, i);
174 }
175
176 ivec4 __constructor (const float f) {
177 return ivec4 (int (f));
178 }
179
180 ivec4 __constructor (const bool b) {
181 return ivec4 (int (b));
182 }
183
184 bvec2 __constructor (const bool b) {
185 return bvec2 (b, b);
186 }
187
188 bvec2 __constructor (const float f) {
189 return bvec2 (bool (f));
190 }
191
192 bvec2 __constructor (const int i) {
193 return bvec2 (bool (i));
194 }
195
196 bvec3 __constructor (const bool b) {
197 return bvec3 (b, b, b);
198 }
199
200 bvec3 __constructor (const float f) {
201 return bvec3 (bool (f));
202 }
203
204 bvec3 __constructor (const int i) {
205 return bvec3 (bool (i));
206 }
207
208 bvec4 __constructor (const bool b) {
209 return bvec4 (b, b, b, b);
210 }
211
212 bvec4 __constructor (const float f) {
213 return bvec4 (bool (f));
214 }
215
216 bvec4 __constructor (const int i) {
217 return bvec4 (bool (i));
218 }
219
220 mat2 __constructor (const float f) {
221 return mat2 (f, 0.0, 0.0, f);
222 }
223
224 mat2 __constructor (const int i) {
225 float x;
226 __asm int_to_float x, i;
227 return mat2 (x);
228 }
229
230 mat2 __constructor (const bool b) {
231 return mat2 (b ? 1.0 : 0.0);
232 }
233
234 mat3 __constructor (const float f) {
235 return mat3 (f, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, f);
236 }
237
238 mat3 __constructor (const int i) {
239 float x;
240 __asm int_to_float x, i;
241 return mat3 (x);
242 }
243
244 mat3 __constructor (const bool b) {
245 return mat3 (b ? 1.0 : 0.0);
246 }
247
248 mat4 __constructor (const float f) {
249 return mat4 (f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, f);
250 }
251
252 mat4 __constructor (const int i) {
253 float x;
254 __asm int_to_float x, i;
255 return mat4 (x);
256 }
257
258 mat4 __constructor (const bool b) {
259 return mat4 (b ? 1.0 : 0.0);
260 }
261
262 void __operator += (inout float a, const float b) {
263 __asm float_add a, a, b;
264 }
265
266 float __operator - (const float a) {
267 float b;
268 __asm float_negate b, a;
269 return b;
270 }
271
272 void __operator -= (inout float a, const float b) {
273 float c;
274 __asm float_negate c, b;
275 __asm float_add a, a, c;
276 }
277
278 void __operator *= (inout float a, const float b) {
279 __asm float_multiply a, a, b;
280 }
281
282 void __operator /= (inout float a, const float b) {
283 __asm float_divide a, a, b;
284 }
285
286 float __operator + (const float a, const float b) {
287 float c;
288 __asm float_add c, a, b;
289 return c;
290 }
291
292 void __operator += (inout int a, const int b) {
293 a = int (float (a) + float (b));
294 }
295
296 int __operator - (const int a) {
297 float x;
298 int b;
299 __asm int_to_float x, a;
300 __asm float_negate x, x;
301 __asm float_to_int b, x;
302 return b;
303 }
304
305 void __operator -= (inout int a, const int b) {
306 a += -b;
307 }
308
309 float __operator * (const float a, const float b) {
310 float c;
311 __asm float_multiply c, a, b;
312 return c;
313 }
314
315 void __operator *= (inout int a, const int b) {
316 a = int (float (a) * float (b));
317 }
318
319 float __operator / (const float a, const float b) {
320 float c;
321 __asm float_divide c, a, b;
322 return c;
323 }
324
325 void __operator /= (inout int a, const int b) {
326 a = int (float (a) / float (b));
327 }
328
329 void __operator += (inout vec2 v, const vec2 u) {
330 v.x += u.x;
331 v.y += u.y;
332 }
333
334 void __operator -= (inout vec2 v, const vec2 u) {
335 v.x -= u.x;
336 v.y -= u.y;
337 }
338
339 void __operator *= (inout vec2 v, const vec2 u) {
340 v.x *= u.x;
341 v.y *= u.y;
342 }
343
344 void __operator /= (inout vec2 v, const vec2 u) {
345 v.x /= u.x;
346 v.y /= u.y;
347 }
348
349 void __operator += (inout vec3 v, const vec3 u) {
350 v.x += u.x;
351 v.y += u.y;
352 v.z += u.z;
353 }
354
355 void __operator -= (inout vec3 v, const vec3 u) {
356 v.x -= u.x;
357 v.y -= u.y;
358 v.z -= u.z;
359 }
360
361 void __operator *= (inout vec3 v, const vec3 u) {
362 v.x *= u.x;
363 v.y *= u.y;
364 v.z *= u.z;
365 }
366
367 void __operator /= (inout vec3 v, const vec3 u) {
368 v.x /= u.x;
369 v.y /= u.y;
370 v.z /= u.z;
371 }
372
373 void __operator += (inout vec4 v, const vec4 u) {
374 v.x += u.x;
375 v.y += u.y;
376 v.z += u.z;
377 v.w += u.w;
378 }
379
380 void __operator -= (inout vec4 v, const vec4 u) {
381 v.x -= u.x;
382 v.y -= u.y;
383 v.z -= u.z;
384 v.w -= u.w;
385 }
386
387 void __operator *= (inout vec4 v, const vec4 u) {
388 v.x *= u.x;
389 v.y *= u.y;
390 v.z *= u.z;
391 v.w *= u.w;
392 }
393
394 void __operator /= (inout vec4 v, const vec4 u) {
395 v.x /= u.x;
396 v.y /= u.y;
397 v.z /= u.z;
398 v.w /= u.w;
399 }
400
401 void __operator += (inout ivec2 v, const ivec2 u) {
402 v.x += u.x;
403 v.y += u.y;
404 }
405
406 void __operator -= (inout ivec2 v, const ivec2 u) {
407 v.x -= u.x;
408 v.y -= u.y;
409 }
410
411 void __operator *= (inout ivec2 v, const ivec2 u) {
412 v.x *= u.x;
413 v.y *= u.y;
414 }
415
416 void __operator /= (inout ivec2 v, const ivec2 u) {
417 v.x /= u.x;
418 v.y /= u.y;
419 }
420
421 void __operator += (inout ivec3 v, const ivec3 u) {
422 v.x += u.x;
423 v.y += u.y;
424 v.z += u.z;
425 }
426
427 void __operator -= (inout ivec3 v, const ivec3 u) {
428 v.x -= u.x;
429 v.y -= u.y;
430 v.z -= u.z;
431 }
432
433 void __operator *= (inout ivec3 v, const ivec3 u) {
434 v.x *= u.x;
435 v.y *= u.y;
436 v.z *= u.z;
437 }
438
439 void __operator /= (inout ivec3 v, const ivec3 u) {
440 v.x /= u.x;
441 v.y /= u.y;
442 v.z /= u.z;
443 }
444
445 void __operator += (inout ivec4 v, const ivec4 u) {
446 v.x += u.x;
447 v.y += u.y;
448 v.z += u.z;
449 v.w += u.w;
450 }
451
452 void __operator -= (inout ivec4 v, const ivec4 u) {
453 v.x -= u.x;
454 v.y -= u.y;
455 v.z -= u.z;
456 v.w -= u.w;
457 }
458
459 void __operator *= (inout ivec4 v, const ivec4 u) {
460 v.x *= u.x;
461 v.y *= u.y;
462 v.z *= u.z;
463 v.w *= u.w;
464 }
465
466 void __operator /= (inout ivec4 v, const ivec4 u) {
467 v.x /= u.x;
468 v.y /= u.y;
469 v.z /= u.z;
470 v.w /= u.w;
471 }
472
473 void __operator += (inout mat2 m, const mat2 n) {
474 m[0] += n[0];
475 m[1] += n[1];
476 }
477
478 void __operator -= (inout mat2 m, const mat2 n) {
479 m[0] -= n[0];
480 m[1] -= n[1];
481 }
482
483 vec2 __operator * (const mat2 m, const vec2 v) {
484 return vec2 (
485 v.x * m[0].x + v.y * m[1].x,
486 v.x * m[0].y + v.y * m[1].y
487 );
488 }
489
490 mat2 __operator * (const mat2 m, const mat2 n) {
491 return mat2 (m * n[0], m * n[1]);
492 }
493
494 void __operator *= (inout mat2 m, const mat2 n) {
495 m = m * n;
496 }
497
498 void __operator /= (inout mat2 m, const mat2 n) {
499 m[0] /= n[0];
500 m[1] /= n[1];
501 }
502
503 void __operator += (inout mat3 m, const mat3 n) {
504 m[0] += n[0];
505 m[1] += n[1];
506 m[2] += n[2];
507 }
508
509 void __operator -= (inout mat3 m, const mat3 n) {
510 m[0] -= n[0];
511 m[1] -= n[1];
512 m[2] -= n[2];
513 }
514
515 vec3 __operator * (const mat3 m, const vec3 v) {
516 return vec3 (
517 v.x * m[0].x + v.y * m[1].x + v.z * m[2].x,
518 v.x * m[0].y + v.y * m[1].y + v.z * m[2].y,
519 v.x * m[0].z + v.y * m[1].z + v.z * m[2].z
520 );
521 }
522
523 mat3 __operator * (const mat3 m, const mat3 n) {
524 return mat3 (m * n[0], m * n[1], m * n[2]);
525 }
526
527 void __operator *= (inout mat3 m, const mat3 n) {
528 m = m * n;
529 }
530
531 void __operator /= (inout mat3 m, const mat3 n) {
532 m[0] /= n[0];
533 m[1] /= n[1];
534 m[2] /= n[2];
535 }
536
537 void __operator += (inout mat4 m, const mat4 n) {
538 m[0] += n[0];
539 m[1] += n[1];
540 m[2] += n[2];
541 m[3] += n[3];
542 }
543
544 void __operator -= (inout mat4 m, const mat4 n) {
545 m[0] -= n[0];
546 m[1] -= n[1];
547 m[2] -= n[2];
548 m[3] -= n[3];
549 }
550
551 vec4 __operator * (const mat4 m, const vec4 v) {
552 return vec4 (
553 v.x * m[0].x + v.y * m[1].x + v.z * m[2].x + v.w * m[3].x,
554 v.x * m[0].y + v.y * m[1].y + v.z * m[2].y + v.w * m[3].y,
555 v.x * m[0].z + v.y * m[1].z + v.z * m[2].z + v.w * m[3].z,
556 v.x * m[0].w + v.y * m[1].w + v.z * m[2].w + v.w * m[3].w
557 );
558 }
559
560 mat4 __operator * (const mat4 m, const mat4 n) {
561 return mat4 (m * n[0], m * n[1], m * n[2], m * n[3]);
562 }
563
564 void __operator *= (inout mat4 m, const mat4 n) {
565 m = m * n;
566 }
567
568 void __operator /= (inout mat4 m, const mat4 n) {
569 m[0] /= n[0];
570 m[1] /= n[1];
571 m[2] /= n[2];
572 m[3] /= n[3];
573 }
574
575 void __operator += (inout vec2 v, const float a) {
576 v.x += a;
577 v.y += a;
578 }
579
580 void __operator -= (inout vec2 v, const float a) {
581 v.x -= a;
582 v.y -= a;
583 }
584
585 void __operator *= (inout vec2 v, const float a) {
586 v.x *= a;
587 v.y *= a;
588 }
589
590 void __operator /= (inout vec2 v, const float a) {
591 v.x /= a;
592 v.y /= a;
593 }
594
595 void __operator += (inout vec3 v, const float a) {
596 v.x += a;
597 v.y += a;
598 v.z += a;
599 }
600
601 void __operator -= (inout vec3 v, const float a) {
602 v.x -= a;
603 v.y -= a;
604 v.z -= a;
605 }
606
607 void __operator *= (inout vec3 v, const float a) {
608 v.x *= a;
609 v.y *= a;
610 v.z *= a;
611 }
612
613 void __operator /= (inout vec3 v, const float a) {
614 v.x /= a;
615 v.y /= a;
616 v.z /= a;
617 }
618
619 void __operator += (inout vec4 v, const float a) {
620 v.x += a;
621 v.y += a;
622 v.z += a;
623 v.w += a;
624 }
625
626 void __operator -= (inout vec4 v, const float a) {
627 v.x -= a;
628 v.y -= a;
629 v.z -= a;
630 v.w -= a;
631 }
632
633 void __operator *= (inout vec4 v, const float a) {
634 v.x *= a;
635 v.y *= a;
636 v.z *= a;
637 v.w *= a;
638 }
639
640 void __operator /= (inout vec4 v, const float a) {
641 v.x /= a;
642 v.y /= a;
643 v.z /= a;
644 v.w /= a;
645 }
646
647 void __operator += (inout mat2 m, const float a) {
648 m[0] += a;
649 m[1] += a;
650 }
651
652 void __operator -= (inout mat2 m, const float a) {
653 m[0] -= a;
654 m[1] -= a;
655 }
656
657 void __operator *= (inout mat2 m, const float a) {
658 m[0] *= a;
659 m[1] *= a;
660 }
661
662 void __operator /= (inout mat2 m, const float a) {
663 m[0] /= a;
664 m[1] /= a;
665 }
666
667 void __operator += (inout mat3 m, const float a) {
668 m[0] += a;
669 m[1] += a;
670 m[2] += a;
671 }
672
673 void __operator -= (inout mat3 m, const float a) {
674 m[0] -= a;
675 m[1] -= a;
676 m[2] -= a;
677 }
678
679 void __operator *= (inout mat3 m, const float a) {
680 m[0] *= a;
681 m[1] *= a;
682 m[2] *= a;
683 }
684
685 void __operator /= (inout mat3 m, const float a) {
686 m[0] /= a;
687 m[1] /= a;
688 m[2] /= a;
689 }
690
691 void __operator += (inout mat4 m, const float a) {
692 m[0] += a;
693 m[1] += a;
694 m[2] += a;
695 m[3] += a;
696 }
697
698 void __operator -= (inout mat4 m, const float a) {
699 m[0] -= a;
700 m[1] -= a;
701 m[2] -= a;
702 m[3] -= a;
703 }
704
705 void __operator *= (inout mat4 m, const float a) {
706 m[0] *= a;
707 m[1] *= a;
708 m[2] *= a;
709 m[3] *= a;
710 }
711
712 void __operator /= (inout mat4 m, const float a) {
713 m[0] /= a;
714 m[1] /= a;
715 m[2] /= a;
716 m[3] /= a;
717 }
718
719 vec2 __operator * (const vec2 v, const mat2 m) {
720 return vec2 (
721 v.x * m[0].x + v.y * m[0].y,
722 v.x * m[1].x + v.y * m[1].y
723 );
724 }
725
726 void __operator *= (inout vec2 v, const mat2 m) {
727 v = v * m;
728 }
729
730 vec3 __operator * (const vec3 v, const mat3 m) {
731 return vec3 (
732 v.x * m[0].x + v.y * m[0].y + v.z * m[0].z,
733 v.x * m[1].x + v.y * m[1].y + v.z * m[1].z,
734 v.x * m[2].x + v.y * m[2].y + v.z * m[2].z
735 );
736 }
737
738 void __operator *= (inout vec3 v, const mat3 m) {
739 v = v * m;
740 }
741
742 vec4 __operator * (const vec4 v, const mat4 m) {
743 return vec4 (
744 v.x * m[0].x + v.y * m[0].y + v.z * m[0].z + v.w * m[0].w,
745 v.x * m[1].x + v.y * m[1].y + v.z * m[1].z + v.w * m[1].w,
746 v.x * m[2].x + v.y * m[2].y + v.z * m[2].z + v.w * m[2].w,
747 v.x * m[3].x + v.y * m[3].y + v.z * m[3].z + v.w * m[3].w
748 );
749 }
750
751 void __operator *= (inout vec4 v, const mat4 m) {
752 v = v * m;
753 }
754
755 float __operator - (const float a, const float b) {
756 float c;
757 __asm float_negate c, b;
758 __asm float_add c, a, c;
759 return c;
760 }
761
762 int __operator + (const int a, const int b) {
763 float x, y;
764 int c;
765 __asm int_to_float x, a;
766 __asm int_to_float y, b;
767 __asm float_add x, x, y;
768 __asm float_to_int c, x;
769 return c;
770 }
771
772 int __operator - (const int a, const int b) {
773 float x, y;
774 int c;
775 __asm int_to_float x, a;
776 __asm int_to_float y, b;
777 __asm float_negate y, y;
778 __asm float_add x, x, y;
779 __asm float_to_int c, x;
780 return c;
781 }
782
783 int __operator * (const int a, const int b) {
784 float x, y;
785 int c;
786 __asm int_to_float x, a;
787 __asm int_to_float y, b;
788 __asm float_multiply x, x, y;
789 __asm float_to_int c, x;
790 return c;
791 }
792
793 int __operator / (const int a, const int b) {
794 float x, y;
795 int c;
796 __asm int_to_float x, a;
797 __asm int_to_float y, b;
798 __asm float_divide x, x, y;
799 __asm float_to_int c, x;
800 return c;
801 }
802
803 vec2 __operator + (const vec2 v, const vec2 u) {
804 return vec2 (v.x + u.x, v.y + u.y);
805 }
806
807 vec2 __operator - (const vec2 v, const vec2 u) {
808 return vec2 (v.x - u.x, v.y - u.y);
809 }
810
811 vec2 __operator * (const vec2 v, const vec2 u) {
812 return vec2 (v.x * u.x, v.y * u.y);
813 }
814
815 vec2 __operator / (const vec2 v, const vec2 u) {
816 return vec2 (v.x / u.x, v.y / u.y);
817 }
818
819 vec3 __operator + (const vec3 v, const vec3 u) {
820 return vec3 (v.x + u.x, v.y + u.y, v.z + u.z);
821 }
822
823 vec3 __operator - (const vec3 v, const vec3 u) {
824 return vec3 (v.x - u.x, v.y - u.y, v.z - u.z);
825 }
826
827 vec3 __operator * (const vec3 v, const vec3 u) {
828 return vec3 (v.x * u.x, v.y * u.y, v.z * u.z);
829 }
830
831 vec3 __operator / (const vec3 v, const vec3 u) {
832 return vec3 (v.x / u.x, v.y / u.y, v.z / u.z);
833 }
834
835 vec4 __operator + (const vec4 v, const vec4 u) {
836 return vec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
837 }
838
839 vec4 __operator - (const vec4 v, const vec4 u) {
840 return vec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
841 }
842
843 vec4 __operator * (const vec4 v, const vec4 u) {
844 return vec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
845 }
846
847 vec4 __operator / (const vec4 v, const vec4 u) {
848 return vec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
849 }
850
851 ivec2 __operator + (const ivec2 v, const ivec2 u) {
852 return ivec2 (v.x + u.x, v.y + u.y);
853 }
854
855 ivec2 __operator - (const ivec2 v, const ivec2 u) {
856 return ivec2 (v.x - u.x, v.y - u.y);
857 }
858
859 ivec2 __operator * (const ivec2 v, const ivec2 u) {
860 return ivec2 (v.x * u.x, v.y * u.y);
861 }
862
863 ivec2 __operator / (const ivec2 v, const ivec2 u) {
864 return ivec2 (v.x / u.x, v.y / u.y);
865 }
866
867 ivec3 __operator + (const ivec3 v, const ivec3 u) {
868 return ivec3 (v.x + u.x, v.y + u.y, v.z + u.z);
869 }
870
871 ivec3 __operator - (const ivec3 v, const ivec3 u) {
872 return ivec3 (v.x - u.x, v.y - u.y, v.z - u.z);
873 }
874
875 ivec3 __operator * (const ivec3 v, const ivec3 u) {
876 return ivec3 (v.x * u.x, v.y * u.y, v.z * u.z);
877 }
878
879 ivec3 __operator / (const ivec3 v, const ivec3 u) {
880 return ivec3 (v.x / u.x, v.y / u.y, v.z / u.z);
881 }
882
883 ivec4 __operator + (const ivec4 v, const ivec4 u) {
884 return ivec4 (v.x + u.x, v.y + u.y, v.z + u.z, v.w + u.w);
885 }
886
887 ivec4 __operator - (const ivec4 v, const ivec4 u) {
888 return ivec4 (v.x - u.x, v.y - u.y, v.z - u.z, v.w - u.w);
889 }
890
891 ivec4 __operator * (const ivec4 v, const ivec4 u) {
892 return ivec4 (v.x * u.x, v.y * u.y, v.z * u.z, v.w * u.w);
893 }
894
895 ivec4 __operator / (const ivec4 v, const ivec4 u) {
896 return ivec4 (v.x / u.x, v.y / u.y, v.z / u.z, v.w / u.w);
897 }
898
899 mat2 __operator + (const mat2 m, const mat2 n) {
900 return mat2 (m[0] + n[0], m[1] + n[1]);
901 }
902
903 mat2 __operator - (const mat2 m, const mat2 n) {
904 return mat2 (m[0] - n[0], m[1] - n[1]);
905 }
906
907 mat2 __operator / (const mat2 m, const mat2 n) {
908 return mat2 (m[0] / n[0], m[1] / n[1]);
909 }
910
911 mat3 __operator + (const mat3 m, const mat3 n) {
912 return mat3 (m[0] + n[0], m[1] + n[1], m[2] + n[2]);
913 }
914
915 mat3 __operator - (const mat3 m, const mat3 n) {
916 return mat3 (m[0] - n[0], m[1] - n[1], m[2] - n[2]);
917 }
918
919 mat3 __operator / (const mat3 m, const mat3 n) {
920 return mat3 (m[0] / n[0], m[1] / n[1], m[2] / n[2]);
921 }
922
923 mat4 __operator + (const mat4 m, const mat4 n) {
924 return mat4 (m[0] + n[0], m[1] + n[1], m[2] + n[2], m[3] + n[3]);
925 }
926
927 mat4 __operator - (const mat4 m, const mat4 n) {
928 return mat4 (m[0] - n[0], m[1] - n[1], m[2] - n[2], m[3] - n[3]);
929 }
930
931 mat4 __operator / (const mat4 m, const mat4 n) {
932 return mat4 (m[0] / n[0], m[1] / n[1], m[2] / n[2], m[3] / n[3]);
933 }
934
935 vec2 __operator + (const float a, const vec2 u) {
936 return vec2 (a + u.x, a + u.y);
937 }
938
939 vec2 __operator + (const vec2 v, const float b) {
940 return vec2 (v.x + b, v.y + b);
941 }
942
943 vec2 __operator - (const float a, const vec2 u) {
944 return vec2 (a - u.x, a - u.y);
945 }
946
947 vec2 __operator - (const vec2 v, const float b) {
948 return vec2 (v.x - b, v.y - b);
949 }
950
951 vec2 __operator * (const float a, const vec2 u) {
952 return vec2 (a * u.x, a * u.y);
953 }
954
955 vec2 __operator * (const vec2 v, const float b) {
956 return vec2 (v.x * b, v.y * b);
957 }
958
959 vec2 __operator / (const float a, const vec2 u) {
960 return vec2 (a / u.x, a / u.y);
961 }
962
963 vec2 __operator / (const vec2 v, const float b) {
964 return vec2 (v.x / b, v.y / b);
965 }
966
967 vec3 __operator + (const float a, const vec3 u) {
968 return vec3 (a + u.x, a + u.y, a + u.z);
969 }
970
971 vec3 __operator + (const vec3 v, const float b) {
972 return vec3 (v.x + b, v.y + b, v.z + b);
973 }
974
975 vec3 __operator - (const float a, const vec3 u) {
976 return vec3 (a - u.x, a - u.y, a - u.z);
977 }
978
979 vec3 __operator - (const vec3 v, const float b) {
980 return vec3 (v.x - b, v.y - b, v.z - b);
981 }
982
983 vec3 __operator * (const float a, const vec3 u) {
984 return vec3 (a * u.x, a * u.y, a * u.z);
985 }
986
987 vec3 __operator * (const vec3 v, const float b) {
988 return vec3 (v.x * b, v.y * b, v.z * b);
989 }
990
991 vec3 __operator / (const float a, const vec3 u) {
992 return vec3 (a / u.x, a / u.y, a / u.z);
993 }
994
995 vec3 __operator / (const vec3 v, const float b) {
996 return vec3 (v.x / b, v.y / b, v.z / b);
997 }
998
999 vec4 __operator + (const float a, const vec4 u) {
1000 return vec4 (a + u.x, a + u.y, a + u.z, a + u.w);
1001 }
1002
1003 vec4 __operator + (const vec4 v, const float b) {
1004 return vec4 (v.x + b, v.y + b, v.z + b, v.w + b);
1005 }
1006
1007 vec4 __operator - (const float a, const vec4 u) {
1008 return vec4 (a - u.x, a - u.y, a - u.z, a - u.w);
1009 }
1010
1011 vec4 __operator - (const vec4 v, const float b) {
1012 return vec4 (v.x - b, v.y - b, v.z - b, v.w - b);
1013 }
1014
1015 vec4 __operator * (const float a, const vec4 u) {
1016 return vec4 (a * u.x, a * u.y, a * u.z, a * u.w);
1017 }
1018
1019 vec4 __operator * (const vec4 v, const float b) {
1020 return vec4 (v.x * b, v.y * b, v.z * b, v.w * b);
1021 }
1022
1023 vec4 __operator / (const float a, const vec4 u) {
1024 return vec4 (a / u.x, a / u.y, a / u.z, a / u.w);
1025 }
1026
1027 vec4 __operator / (const vec4 v, const float b) {
1028 return vec4 (v.x / b, v.y / b, v.z / b, v.w / b);
1029 }
1030
1031 mat2 __operator + (const float a, const mat2 n) {
1032 return mat2 (a + n[0], a + n[1]);
1033 }
1034
1035 mat2 __operator + (const mat2 m, const float b) {
1036 return mat2 (m[0] + b, m[1] + b);
1037 }
1038
1039 mat2 __operator - (const float a, const mat2 n) {
1040 return mat2 (a - n[0], a - n[1]);
1041 }
1042
1043 mat2 __operator - (const mat2 m, const float b) {
1044 return mat2 (m[0] - b, m[1] - b);
1045 }
1046
1047 mat2 __operator * (const float a, const mat2 n) {
1048 return mat2 (a * n[0], a * n[1]);
1049 }
1050
1051 mat2 __operator * (const mat2 m, const float b) {
1052 return mat2 (m[0] * b, m[1] * b);
1053 }
1054
1055 mat2 __operator / (const float a, const mat2 n) {
1056 return mat2 (a / n[0], a / n[1]);
1057 }
1058
1059 mat2 __operator / (const mat2 m, const float b) {
1060 return mat2 (m[0] / b, m[1] / b);
1061 }
1062
1063 mat3 __operator + (const float a, const mat3 n) {
1064 return mat3 (a + n[0], a + n[1], a + n[2]);
1065 }
1066
1067 mat3 __operator + (const mat3 m, const float b) {
1068 return mat3 (m[0] + b, m[1] + b, m[2] + b);
1069 }
1070
1071 mat3 __operator - (const float a, const mat3 n) {
1072 return mat3 (a - n[0], a - n[1], a - n[2]);
1073 }
1074
1075 mat3 __operator - (const mat3 m, const float b) {
1076 return mat3 (m[0] - b, m[1] - b, m[2] - b);
1077 }
1078
1079 mat3 __operator * (const float a, const mat3 n) {
1080 return mat3 (a * n[0], a * n[1], a * n[2]);
1081 }
1082
1083 mat3 __operator * (const mat3 m, const float b) {
1084 return mat3 (m[0] * b, m[1] * b, m[2] * b);
1085 }
1086
1087 mat3 __operator / (const float a, const mat3 n) {
1088 return mat3 (a / n[0], a / n[1], a / n[2]);
1089 }
1090
1091 mat3 __operator / (const mat3 m, const float b) {
1092 return mat3 (m[0] / b, m[1] / b, m[2] / b);
1093 }
1094
1095 mat4 __operator + (const float a, const mat4 n) {
1096 return mat4 (a + n[0], a + n[1], a + n[2], a + n[3]);
1097 }
1098
1099 mat4 __operator + (const mat4 m, const float b) {
1100 return mat4 (m[0] + b, m[1] + b, m[2] + b, m[3] + b);
1101 }
1102
1103 mat4 __operator - (const float a, const mat4 n) {
1104 return mat4 (a - n[0], a - n[1], a - n[2], a - n[3]);
1105 }
1106
1107 mat4 __operator - (const mat4 m, const float b) {
1108 return mat4 (m[0] - b, m[1] - b, m[2] - b, m[3] - b);
1109 }
1110
1111 mat4 __operator * (const float a, const mat4 n) {
1112 return mat4 (a * n[0], a * n[1], a * n[2], a * n[3]);
1113 }
1114
1115 mat4 __operator * (const mat4 m, const float b) {
1116 return mat4 (m[0] * b, m[1] * b, m[2] * b, m[3] * b);
1117 }
1118
1119 mat4 __operator / (const float a, const mat4 n) {
1120 return mat4 (a / n[0], a / n[1], a / n[2], a / n[3]);
1121 }
1122
1123 mat4 __operator / (const mat4 m, const float b) {
1124 return mat4 (m[0] / b, m[1] / b, m[2] / b, m[3] / b);
1125 }
1126
1127 ivec2 __operator + (const int a, const ivec2 u) {
1128 return ivec2 (a) + u;
1129 }
1130
1131 ivec2 __operator + (const ivec2 v, const int b) {
1132 return v + ivec2 (b);
1133 }
1134
1135 ivec2 __operator - (const int a, const ivec2 u) {
1136 return ivec2 (a) - u;
1137 }
1138
1139 ivec2 __operator - (const ivec2 v, const int b) {
1140 return v - ivec2 (b);
1141 }
1142
1143 ivec2 __operator * (const int a, const ivec2 u) {
1144 return ivec2 (a) * u;
1145 }
1146
1147 ivec2 __operator * (const ivec2 v, const int b) {
1148 return v * ivec2 (b);
1149 }
1150
1151 ivec2 __operator / (const int a, const ivec2 u) {
1152 return ivec2 (a) / u;
1153 }
1154
1155 ivec2 __operator / (const ivec2 v, const int b) {
1156 return v / ivec2 (b);
1157 }
1158
1159 ivec3 __operator + (const int a, const ivec3 u) {
1160 return ivec3 (a) + u;
1161 }
1162
1163 ivec3 __operator + (const ivec3 v, const int b) {
1164 return v + ivec3 (b);
1165 }
1166
1167 ivec3 __operator - (const int a, const ivec3 u) {
1168 return ivec3 (a) - u;
1169 }
1170
1171 ivec3 __operator - (const ivec3 v, const int b) {
1172 return v - ivec3 (b);
1173 }
1174
1175 ivec3 __operator * (const int a, const ivec3 u) {
1176 return ivec3 (a) * u;
1177 }
1178
1179 ivec3 __operator * (const ivec3 v, const int b) {
1180 return v * ivec3 (b);
1181 }
1182
1183 ivec3 __operator / (const int a, const ivec3 u) {
1184 return ivec3 (a) / u;
1185 }
1186
1187 ivec3 __operator / (const ivec3 v, const int b) {
1188 return v / ivec3 (b);
1189 }
1190
1191 ivec4 __operator + (const int a, const ivec4 u) {
1192 return ivec4 (a) + u;
1193 }
1194
1195 ivec4 __operator + (const ivec4 v, const int b) {
1196 return v + ivec4 (b);
1197 }
1198
1199 ivec4 __operator - (const int a, const ivec4 u) {
1200 return ivec4 (a) - u;
1201 }
1202
1203 ivec4 __operator - (const ivec4 v, const int b) {
1204 return v - ivec4 (b);
1205 }
1206
1207 ivec4 __operator * (const int a, const ivec4 u) {
1208 return ivec4 (a) * u;
1209 }
1210
1211 ivec4 __operator * (const ivec4 v, const int b) {
1212 return v * ivec4 (b);
1213 }
1214
1215 ivec4 __operator / (const int a, const ivec4 u) {
1216 return ivec4 (a) / u;
1217 }
1218
1219 ivec4 __operator / (const ivec4 v, const int b) {
1220 return v / ivec4 (b);
1221 }
1222
1223 vec2 __operator - (const vec2 v) {
1224 return vec2 (-v.x, -v.y);
1225 }
1226
1227 vec3 __operator - (const vec3 v) {
1228 return vec3 (-v.x, -v.y, -v.z);
1229 }
1230
1231 vec4 __operator - (const vec4 v) {
1232 return vec4 (-v.x, -v.y, -v.z, -v.w);
1233 }
1234
1235 ivec2 __operator - (const ivec2 v) {
1236 return ivec2 (-v.x, -v.y);
1237 }
1238
1239 ivec3 __operator - (const ivec3 v) {
1240 return ivec3 (-v.x, -v.y, -v.z);
1241 }
1242
1243 ivec4 __operator - (const ivec4 v) {
1244 return ivec4 (-v.x, -v.y, -v.z, -v.w);
1245 }
1246
1247 mat2 __operator - (const mat2 m) {
1248 return mat2 (-m[0], -m[1]);
1249 }
1250
1251 mat3 __operator - (const mat3 m) {
1252 return mat3 (-m[0], -m[1], -m[2]);
1253 }
1254
1255 mat4 __operator - (const mat4 m) {
1256 return mat4 (-m[0], -m[1], -m[2], -m[3]);
1257 }
1258
1259 void __operator -- (inout float a) {
1260 a -= 1.0;
1261 }
1262
1263 void __operator -- (inout int a) {
1264 a -= 1;
1265 }
1266
1267 void __operator -- (inout vec2 v) {
1268 --v.x;
1269 --v.y;
1270 }
1271
1272 void __operator -- (inout vec3 v) {
1273 --v.x;
1274 --v.y;
1275 --v.z;
1276 }
1277
1278 void __operator -- (inout vec4 v) {
1279 --v.x;
1280 --v.y;
1281 --v.z;
1282 --v.w;
1283 }
1284
1285 void __operator -- (inout ivec2 v) {
1286 --v.x;
1287 --v.y;
1288 }
1289
1290 void __operator -- (inout ivec3 v) {
1291 --v.x;
1292 --v.y;
1293 --v.z;
1294 }
1295
1296 void __operator -- (inout ivec4 v) {
1297 --v.x;
1298 --v.y;
1299 --v.z;
1300 --v.w;
1301 }
1302
1303 void __operator -- (inout mat2 m) {
1304 --m[0];
1305 --m[1];
1306 }
1307
1308 void __operator -- (inout mat3 m) {
1309 --m[0];
1310 --m[1];
1311 --m[2];
1312 }
1313
1314 void __operator -- (inout mat4 m) {
1315 --m[0];
1316 --m[1];
1317 --m[2];
1318 --m[3];
1319 }
1320
1321 void __operator ++ (inout float a) {
1322 a += 1.0;
1323 }
1324
1325 void __operator ++ (inout int a) {
1326 a += 1;
1327 }
1328
1329 void __operator ++ (inout vec2 v) {
1330 ++v.x;
1331 ++v.y;
1332 }
1333
1334 void __operator ++ (inout vec3 v) {
1335 ++v.x;
1336 ++v.y;
1337 ++v.z;
1338 }
1339
1340 void __operator ++ (inout vec4 v) {
1341 ++v.x;
1342 ++v.y;
1343 ++v.z;
1344 ++v.w;
1345 }
1346
1347 void __operator ++ (inout ivec2 v) {
1348 ++v.x;
1349 ++v.y;
1350 }
1351
1352 void __operator ++ (inout ivec3 v) {
1353 ++v.x;
1354 ++v.y;
1355 ++v.z;
1356 }
1357
1358 void __operator ++ (inout ivec4 v) {
1359 ++v.x;
1360 ++v.y;
1361 ++v.z;
1362 ++v.w;
1363 }
1364
1365 void __operator ++ (inout mat2 m) {
1366 ++m[0];
1367 ++m[1];
1368 }
1369
1370 void __operator ++ (inout mat3 m) {
1371 ++m[0];
1372 ++m[1];
1373 ++m[2];
1374 }
1375
1376 void __operator ++ (inout mat4 m) {
1377 ++m[0];
1378 ++m[1];
1379 ++m[2];
1380 ++m[3];
1381 }
1382
1383 //
1384 // NOTE: postfix increment and decrement operators take additional dummy int parameter to
1385 // distinguish their prototypes from prefix ones.
1386 //
1387
1388 float __operator -- (inout float a, const int) {
1389 float b;
1390 b = a;
1391 --a;
1392 return b;
1393 }
1394
1395 int __operator -- (inout int a, const int) {
1396 int b;
1397 b = a;
1398 --a;
1399 return b;
1400 }
1401
1402 vec2 __operator -- (inout vec2 v, const int) {
1403 return vec2 (v.x--, v.y--);
1404 }
1405
1406 vec3 __operator -- (inout vec3 v, const int) {
1407 return vec3 (v.x--, v.y--, v.z--);
1408 }
1409
1410 vec4 __operator -- (inout vec4 v, const int) {
1411 return vec4 (v.x--, v.y--, v.z--, v.w--);
1412 }
1413
1414 ivec2 __operator -- (inout ivec2 v, const int) {
1415 return ivec2 (v.x--, v.y--);
1416 }
1417
1418 ivec3 __operator -- (inout ivec3 v, const int) {
1419 return ivec3 (v.x--, v.y--, v.z--);
1420 }
1421
1422 ivec4 __operator -- (inout ivec4 v, const int) {
1423 return ivec4 (v.x--, v.y--, v.z--, v.w--);
1424 }
1425
1426 mat2 __operator -- (inout mat2 m, const int) {
1427 return mat2 (m[0]--, m[1]--);
1428 }
1429
1430 mat3 __operator -- (inout mat3 m, const int) {
1431 return mat3 (m[0]--, m[1]--, m[2]--);
1432 }
1433
1434 mat4 __operator -- (inout mat4 m, const int) {
1435 return mat4 (m[0]--, m[1]--, m[2]--, m[3]--);
1436 }
1437
1438 float __operator ++ (inout float a, const int) {
1439 float b;
1440 b = a;
1441 ++a;
1442 return b;
1443 }
1444
1445 int __operator ++ (inout int a, const int) {
1446 int b;
1447 b = a;
1448 ++a;
1449 return b;
1450 }
1451
1452 vec2 __operator ++ (inout vec2 v, const int) {
1453 return vec2 (v.x++, v.y++);
1454 }
1455
1456 vec3 __operator ++ (inout vec3 v, const int) {
1457 return vec3 (v.x++, v.y++, v.z++);
1458 }
1459
1460 vec4 __operator ++ (inout vec4 v, const int) {
1461 return vec4 (v.x++, v.y++, v.z++, v.w++);
1462 }
1463
1464 ivec2 __operator ++ (inout ivec2 v, const int) {
1465 return ivec2 (v.x++, v.y++);
1466 }
1467
1468 ivec3 __operator ++ (inout ivec3 v, const int) {
1469 return ivec3 (v.x++, v.y++, v.z++);
1470 }
1471
1472 ivec4 __operator ++ (inout ivec4 v, const int) {
1473 return ivec4 (v.x++, v.y++, v.z++, v.w++);
1474 }
1475
1476 mat2 __operator ++ (inout mat2 m, const int) {
1477 return mat2 (m[0]++, m[1]++);
1478 }
1479
1480 mat3 __operator ++ (inout mat3 m, const int) {
1481 return mat3 (m[0]++, m[1]++, m[2]++);
1482 }
1483
1484 mat4 __operator ++ (inout mat4 m, const int) {
1485 return mat4 (m[0]++, m[1]++, m[2]++, m[3]++);
1486 }
1487
1488 bool __operator < (const float a, const float b) {
1489 bool c;
1490 __asm float_less c, a, b;
1491 return c;
1492 }
1493
1494 bool __operator < (const int a, const int b) {
1495 return float (a) < float (b);
1496 }
1497
1498 bool __operator > (const float a, const float b) {
1499 bool c;
1500 __asm float_less c, b, a;
1501 return c;
1502 }
1503
1504 bool __operator > (const int a, const int b) {
1505 return float (a) > float (b);
1506 }
1507
1508 bool __operator >= (const float a, const float b) {
1509 bool g, e;
1510 __asm float_less g, b, a;
1511 __asm float_equal e, a, b;
1512 return g || e;
1513 }
1514
1515 bool __operator >= (const int a, const int b) {
1516 return float (a) >= float (b);
1517 }
1518
1519 bool __operator <= (const float a, const float b) {
1520 bool g, e;
1521 __asm float_less g, a, b;
1522 __asm float_equal e, a, b;
1523 return g || e;
1524 }
1525
1526 bool __operator <= (const int a, const int b) {
1527 return float (a) <= float (b);
1528 }
1529
1530 bool __operator ^^ (const bool a, const bool b) {
1531 return a != b;
1532 }
1533
1534 //
1535 // These operators are handled internally by the compiler:
1536 //
1537 // bool __operator && (bool a, bool b) {
1538 // return a ? b : false;
1539 // }
1540 // bool __operator || (bool a, bool b) {
1541 // return a ? true : b;
1542 // }
1543 //
1544
1545 bool __operator ! (const bool a) {
1546 return a == false;
1547 }
1548
1549 //
1550 // mesa-specific extension functions.
1551 //
1552
1553 void print (const float f) {
1554 __asm float_print f;
1555 }
1556
1557 void print (const int i) {
1558 __asm int_print i;
1559 }
1560
1561 void print (const bool b) {
1562 __asm bool_print b;
1563 }
1564
1565 void print (const vec2 v) {
1566 print (v.x);
1567 print (v.y);
1568 }
1569
1570 void print (const vec3 v) {
1571 print (v.x);
1572 print (v.y);
1573 print (v.z);
1574 }
1575
1576 void print (const vec4 v) {
1577 print (v.x);
1578 print (v.y);
1579 print (v.z);
1580 print (v.w);
1581 }
1582
1583 void print (const ivec2 v) {
1584 print (v.x);
1585 print (v.y);
1586 }
1587
1588 void print (const ivec3 v) {
1589 print (v.x);
1590 print (v.y);
1591 print (v.z);
1592 }
1593
1594 void print (const ivec4 v) {
1595 print (v.x);
1596 print (v.y);
1597 print (v.z);
1598 print (v.w);
1599 }
1600
1601 void print (const bvec2 v) {
1602 print (v.x);
1603 print (v.y);
1604 }
1605
1606 void print (const bvec3 v) {
1607 print (v.x);
1608 print (v.y);
1609 print (v.z);
1610 }
1611
1612 void print (const bvec4 v) {
1613 print (v.x);
1614 print (v.y);
1615 print (v.z);
1616 print (v.w);
1617 }
1618
1619 void print (const mat2 m) {
1620 print (m[0]);
1621 print (m[1]);
1622 }
1623
1624 void print (const mat3 m) {
1625 print (m[0]);
1626 print (m[1]);
1627 print (m[2]);
1628 }
1629
1630 void print (const mat4 m) {
1631 print (m[0]);
1632 print (m[1]);
1633 print (m[2]);
1634 print (m[3]);
1635 }
1636
1637 void print (const sampler1D e) {
1638 __asm int_print e;
1639 }
1640
1641 void print (const sampler2D e) {
1642 __asm int_print e;
1643 }
1644
1645 void print (const sampler3D e) {
1646 __asm int_print e;
1647 }
1648
1649 void print (const samplerCube e) {
1650 __asm int_print e;
1651 }
1652
1653 void print (const sampler1DShadow e) {
1654 __asm int_print e;
1655 }
1656
1657 void print (const sampler2DShadow e) {
1658 __asm int_print e;
1659 }
1660