blob: 5992987aa5165a6337ea8a55e0ea3898e0d31442 [file] [log] [blame]
John Kessenich04de88f2013-06-02 22:57:37 +00001#version 300 es
2
3uniform block {
John Kessenich41a36bb2013-06-19 05:41:25 +00004 mediump float f;
John Kessenich04de88f2013-06-02 22:57:37 +00005} instanceName;
6
7struct S {
8 int i;
9} s;
10
11float a[5];
12
13void main()
14{
15 bool b;
16 float f;
17 int i;
18 uint u;
19 bvec3 b3;
20 vec3 v3;
21 ivec3 iv3;
22 uvec3 uv3;
23 vec4 v4;
24 ivec4 iv4;
25 uvec4 uv4;
26 mat2 m2;
27 mat4 m4;
28
29 // These are all errors:
30 instanceName + instanceName;
31 s + s;
32 i + f;
33 u + f;
34 u + i;
35 iv3 *= iv4;
36 iv4 / uv4;
37 i - v3;
38 iv3 + uv3;
39 a * a;
40 b / b;
41
42 f % f;
43 i % f;
44 f % u;
45 instanceName++;
46 ++s;
47 a--;
48 ++b3;
49
50 iv3 < uv3;
51 m2 > m2;
52 m2 != m4;
53 i >= u;
54 a <= a;
55 b > b;
56
57 b && b3;
58 b3 ^^ b3;
59 b3 || b;
60 i && i;
61 u || u;
62 m2 ^^ m2;
63
64 !u;
65 !i;
66 !m2;
67 !v3;
68 !a;
69
70 ~f;
71 ~m4;
72 ~v3;
73 ~a;
74 ~instanceName;
75
76 i << iv3;
77 u << uv3;
78 i >> f;
79 f >> i;
80 m4 >> i;
81 a >> u;
John Kessenichf78fff92013-06-13 23:56:04 +000082 iv3 >> iv4;
John Kessenich04de88f2013-06-02 22:57:37 +000083
John Kessenich77d908a2013-11-09 00:18:22 +000084 i & u;
85 u &= uv3;
John Kessenich04de88f2013-06-02 22:57:37 +000086 i | uv3;
87 u & f;
88 m2 | m2;
89 s ^ s;
John Kessenichf78fff92013-06-13 23:56:04 +000090 (f = f) = f;
John Kessenich04de88f2013-06-02 22:57:37 +000091
92 // These are all okay:
93 f * v4;
94 u + u;
95 uv4 / u;
96 iv3 -= iv3;
97
98 i %= 3;
99 uv3 % 4u;
100 --m2;
101 iv4++;
102
103 m4 != m4;
104 m2 == m2;
105 i <= i;
106 a == a;
107 s != s;
108
109 b && b;
110 b || b;
111 b ^^ b;
112
113 !b, uv3;
114
115 ~i;
116 ~u;
117 ~uv3;
118 ~iv3;
119
120 uv3 <<= i;
121 i >> i;
122 u << u;
John Kessenichf78fff92013-06-13 23:56:04 +0000123 iv3 >> iv3;
John Kessenich04de88f2013-06-02 22:57:37 +0000124
125 i & i;
126 u | u;
127 iv3 ^ iv3;
John Kessenich77d908a2013-11-09 00:18:22 +0000128 u & uv3;
129 uv3 | u;
130 uv3 &= u;
131 int arr[0x222 & 0xf];
132 arr[1]; // size 2
133 int arr2[(uvec2(0, 0x2) | 0x1u).y];
134 arr2[2]; // size 3
John Kessenich04de88f2013-06-02 22:57:37 +0000135}