blob: bc34d7acd4df6b3dd8404ea28bffefc730473f46 [file] [log] [blame]
John Kesseniche23c9842016-01-04 23:49:03 -07001#version 450
John Kessenich39374da2015-05-15 21:32:46 +00002
John Kessenich55e7d112015-11-15 21:33:39 -07003uniform sampler2D samp2D;
John Kesseniche23c9842016-01-04 23:49:03 -07004in mediump vec2 coord;
John Kessenich39374da2015-05-15 21:32:46 +00005
John Kesseniche23c9842016-01-04 23:49:03 -07006in vec4 u, w;
7out vec4 color;
John Kessenich39374da2015-05-15 21:32:46 +00008
9struct s1 {
10 int i;
11 float f;
12};
13
14struct s2 {
15 int i;
16 float f;
17 s1 s1_1;
18};
19
John Kessenich6c292d32016-02-15 20:58:50 -070020layout(std140) uniform ub1 { s2 foo2a; } uName1;
21layout(std430) buffer ub2 { s2 foo2b; } uName2;
John Kesseniche23c9842016-01-04 23:49:03 -070022
John Kessenich39374da2015-05-15 21:32:46 +000023void main()
24{
25 vec4 v;
26 s1 a[3], b[3];
27 a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0));
28 b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w));
29
John Kessenich6c292d32016-02-15 20:58:50 -070030 if (uName1.foo2a == uName2.foo2b)
John Kessenich55e7d112015-11-15 21:33:39 -070031 v = texture(samp2D, coord);
John Kessenich39374da2015-05-15 21:32:46 +000032 else
John Kessenich55e7d112015-11-15 21:33:39 -070033 v = texture(samp2D, 2.0*coord);
John Kessenich39374da2015-05-15 21:32:46 +000034
35 if (u == v)
36 v *= 3.0;
37
38 if (u != v)
39 v *= 4.0;
40
41 if (coord == v.yw)
42 v *= 5.0;
43
44 if (a == b)
45 v *= 6.0;
46
47 if (a != b)
48 v *= 7.0;
49
John Kesseniche23c9842016-01-04 23:49:03 -070050 color = v;
John Kessenich39374da2015-05-15 21:32:46 +000051}