blob: 090c1a6a1398460b7ee00a14f1f4be676dfd14e2 [file] [log] [blame]
John Kessenichf6eae2a2016-01-22 17:47:22 -07001#version 310 es
John Kessenich39374da2015-05-15 21:32:46 +00002precision mediump float;
3in lowp float lowfin;
4in mediump float mediumfin;
5in highp vec4 highfin;
6
John Kessenich6c292d32016-02-15 20:58:50 -07007highp int uniform_high;
8mediump int uniform_medium;
9lowp int uniform_low;
10bvec2 ub2;
John Kessenich39374da2015-05-15 21:32:46 +000011
12out mediump vec4 mediumfout;
13
14highp float global_highp;
15
16lowp vec2 foo(mediump vec3 mv3)
17{
18 return highfin.xy;
19}
20
21bool boolfun(bvec2 bv2)
22{
23 return bv2 == bvec2(false, true);
24}
25
John Kessenich32cfd492016-02-02 12:37:46 -070026struct S {
27 highp float a;
28 lowp float b;
29};
30
31in S s;
32
John Kessenich39374da2015-05-15 21:32:46 +000033void main()
34{
35 lowp int sum = uniform_medium + uniform_high;
36
37 sum += uniform_high;
38 sum += uniform_low;
39
40 // test maxing precisions of args to get precision of builtin
41 lowp float arg1 = 3.2;
42 mediump float arg2 = 1023908.2;
43 lowp float d = distance(lowfin, mediumfin);
44
45 global_highp = length(highfin);
46
47 highp vec4 local_highp = vec4(global_highp);
48
49 mediumfout = vec4(sin(d)) + arg2 + local_highp;
50
51 sum += 4 + ((ivec2(uniform_low) * ivec2(uniform_high) + ivec2((/* comma operator */uniform_low, uniform_high)))).x;
52
53 mediumfout += vec4(sum);
54
55 if (boolfun(ub2))
56 ++mediumfout;
John Kessenich32cfd492016-02-02 12:37:46 -070057
58 mediumfout *= s.a;
59 mediumfout *= s.b;
John Kessenich39374da2015-05-15 21:32:46 +000060}