File: web.controlFlow.frag

package info (click to toggle)
glslang 16.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,084 kB
  • sloc: cpp: 90,714; yacc: 4,243; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (91 lines) | stat: -rw-r--r-- 1,524 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#version 310 es

precision mediump float;
precision highp int;

int c, d;
layout(location = 0) in highp float x;
layout(location = 1) in vec4 bigColor;
layout(location = 2) in vec4 BaseColor;
layout(location = 3) in float f;

layout(location = 4) flat in int Count;
layout(location = 5) flat in uvec4 v4;

layout(location = 0) out vec4 outColor;

void main()
{
    float f;
    int a[2];

    switch(c)
    {
    }

    switch (c) {      // a no-error normal switch
    case 1:
        f = sin(x);
        break;
    case 2:
        switch (d) {
        case 1:
            f = x * x * x;
            break;
        case 2:
            f = x * x;
            break;
        }
        break;
    default:
        f = tan(x);
    }

    vec4 color = BaseColor;

    for (int i = 0; i < Count; ++i) {
        color += bigColor;
    }

    outColor = color;

    float sum = 0.0;
    for (int i = 0; i < 4; ++i)
        sum += float(v4[i]);

    vec4 tv4;

    for (int i = 0; i < 4; ++i)
        tv4[i] = float(v4[i] * 4u);

    outColor += vec4(sum) + tv4;

    vec4 r;
    r.xyz = BaseColor.xyz;

    for (int i = 0; i < Count; ++i)
        r.w = f;

    outColor.xyz += r.xyz;

    for (int i = 0; i < 16; i += 4)
        outColor *= f;

    int i = 0;
    int A, B, C, D;
    while (i<10) {
        A = 1;
        if (i%2 == 0) {
            B = 2;
            continue;
            C = 2;
        }
        if (i%5 == 0) {
            B = 2;
            break;
            C = 2;
        }
        i++;
    }
    D = 3;
}