File: aggOps.frag

package info (click to toggle)
glslang 15.1.0%2B1.4.309.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 46,976 kB
  • sloc: cpp: 92,728; yacc: 4,145; sh: 609; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (51 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (20)
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
#version 130

uniform sampler2D sampler;
varying mediump vec2 coord;

varying vec4 u, w;

struct s1 {
    int i;
    float f;
};

struct s2 {
    int i;
    float f;
	s1 s1_1;
};

uniform s1 foo1;
uniform s2 foo2a;
uniform s2 foo2b;

void main()
{
    vec4 v;
    s1 a[3], b[3];
    a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0));
    b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w));

    if (foo2a == foo2b)
        v = texture2D(sampler, coord);
    else
        v = texture2D(sampler, 2.0*coord);

    if (u == v)
        v *= 3.0;

    if (u != v)
        v *= 4.0;

    if (coord == v.yw)
        v *= 5.0;

    if (a == b)
        v *= 6.0;

    if (a != b)
        v *= 7.0;

	gl_FragColor =  v;
}