• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 310 es
2precision mediump float;
3in lowp float lowfin;
4in mediump float mediumfin;
5in highp vec4 highfin;
6
7highp int uniform_high;
8mediump int uniform_medium;
9lowp int uniform_low;
10bvec2 ub2;
11
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
26struct S {
27    highp float a;
28    lowp float b;
29};
30
31in S s;
32
33void 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;
57
58    mediumfout *= s.a;
59    mediumfout *= s.b;
60
61    mediumfout = ((mediumfin * mediumfin > 4.2) ? 2.0 * mediumfout : 3.0 * mediumfout);
62}
63