John Kessenich | e23c984 | 2016-01-04 23:49:03 -0700 | [diff] [blame] | 1 | #version 450
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 2 |
|
John Kessenich | 55e7d11 | 2015-11-15 21:33:39 -0700 | [diff] [blame] | 3 | uniform sampler2D samp2D;
|
John Kessenich | e23c984 | 2016-01-04 23:49:03 -0700 | [diff] [blame] | 4 | in mediump vec2 coord;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 5 |
|
John Kessenich | e23c984 | 2016-01-04 23:49:03 -0700 | [diff] [blame] | 6 | in vec4 u, w;
|
| 7 | out vec4 color;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 8 |
|
| 9 | struct s1 {
|
| 10 | int i;
|
| 11 | float f;
|
| 12 | };
|
| 13 |
|
| 14 | struct s2 {
|
| 15 | int i;
|
| 16 | float f;
|
| 17 | s1 s1_1;
|
| 18 | };
|
| 19 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 20 | layout(std140) uniform ub1 { s2 foo2a; } uName1;
|
| 21 | layout(std430) buffer ub2 { s2 foo2b; } uName2;
|
John Kessenich | e23c984 | 2016-01-04 23:49:03 -0700 | [diff] [blame] | 22 |
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 23 | void 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 Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 30 | if (uName1.foo2a == uName2.foo2b)
|
John Kessenich | 55e7d11 | 2015-11-15 21:33:39 -0700 | [diff] [blame] | 31 | v = texture(samp2D, coord);
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 32 | else
|
John Kessenich | 55e7d11 | 2015-11-15 21:33:39 -0700 | [diff] [blame] | 33 | v = texture(samp2D, 2.0*coord);
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 34 |
|
| 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 Kessenich | e23c984 | 2016-01-04 23:49:03 -0700 | [diff] [blame] | 50 | color = v;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 51 | }
|