• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 400
2
3flat in ivec4 uiv4;
4in vec4 uv4;
5bool ub;
6bool uba;
7bvec4 ub41, ub42;
8in float uf;
9flat in int ui;
10
11out float of1;
12out vec4  of4;
13
14bool foo() { ++of1; return of1 > 10.0; }
15
16void main()
17{
18    of1 = 0.0;
19    of4 = vec4(0.0);
20
21    if (ub || ui > 2)  // not worth short circuiting
22        ++of1;
23
24    if (ub && !uba)  // not worth short circuiting
25        ++of1;
26
27    if (ub || foo())   // must short circuit
28        ++of1;
29
30    if (ub && foo())   // must short circuit
31        ++of1;
32
33    if (foo() || ub)   // not worth short circuiting
34        ++of1;
35
36    if (foo() && ub)   // not worth short circuiting
37        ++of1;
38
39    if (ub || ++of1 > 1.0)   // must short circuit
40        ++of4;
41
42    if (++of1 > 1.0 || ub)   // not worth short circuiting
43        ++of4;
44
45    if (ub || sin(uf) * 4.0 > of1)  // worth short circuiting
46        ++of1;
47
48    if (ub && sin(uf) * 4.0 > of1)  // worth short circuiting
49        ++of1;
50}
51