1#version 310 es 2#extension GL_OES_sample_variables : enable 3precision mediump float; 4in lowp float lowfin; 5in mediump float mediumfin; 6in highp vec4 highfin; 7 8highp int uniform_high; 9mediump int uniform_medium; 10lowp int uniform_low; 11bvec2 ub2; 12 13out mediump vec4 mediumfout; 14 15highp float global_highp; 16 17lowp vec2 foo(mediump vec3 mv3) 18{ 19 return highfin.xy; 20} 21 22bool boolfun(bvec2 bv2) 23{ 24 return bv2 == bvec2(false, true); 25} 26 27struct S { 28 highp float a; 29 lowp float b; 30}; 31 32in S s; 33 34void main() 35{ 36 lowp int sum = uniform_medium + uniform_high; 37 38 sum += uniform_high; 39 sum += uniform_low; 40 41 // test maxing precisions of args to get precision of builtin 42 lowp float arg1 = 3.2; 43 mediump float arg2 = 1023908.2; 44 lowp float d = distance(lowfin, mediumfin); 45 46 global_highp = length(highfin); 47 48 highp vec4 local_highp = vec4(global_highp); 49 50 mediumfout = vec4(sin(d)) + arg2 + local_highp; 51 52 sum += 4 + ((ivec2(uniform_low) * ivec2(uniform_high) + ivec2((/* comma operator */uniform_low, uniform_high)))).x; 53 54 mediumfout += vec4(sum); 55 56 if (boolfun(ub2)) 57 ++mediumfout; 58 59 mediumfout *= s.a; 60 mediumfout *= s.b; 61 62 mediumfout = ((mediumfin * mediumfin > 4.2) ? 2.0 * mediumfout : 3.0 * mediumfout); 63 mediumfout = ((gl_SampleMaskIn[0] >> uniform_medium > 0) ? 2.0 * mediumfout : 3.0 * mediumfout); 64} 65