blob: 3f4929b652f470643031f52c9b4b801248336dff [file] [log] [blame]
John Kessenich06e1d0b2015-05-22 21:57:58 +00001#version 420
2
3struct S
4{
5 vec3 color;
6};
7
8layout(location = 0) out vec3 OutColor;
9
John Kessenich6c292d32016-02-15 20:58:50 -070010flat in int u;
John Kessenich06e1d0b2015-05-22 21:57:58 +000011
12void GetColor1(const S i)
13{
14 OutColor += i.color.x;
15}
16
17void GetColor2(const S i, int comp)
18{
19 OutColor += i.color[comp];
20}
21
22void GetColor3(const S i, int comp)
23{
24 OutColor += i.color[comp].x;
25}
26
27void GetColor4(const S i, int comp)
28{
29 OutColor += i.color[comp].x;
30}
31
32void GetColor5(const S i, int comp)
33{
34 OutColor += i.color;
35}
36
37void GetColor6(const S i, int comp)
38{
39 OutColor += i.color.yx[comp];
40}
41
42void GetColor7(const S i, int comp)
43{
44 OutColor.xy += i.color.yxz.yx;
45}
46
47void GetColor8(const S i, int comp)
48{
49 OutColor += i.color.yzx.yx.x.x;
50}
51
52void GetColor9(const S i, int comp)
53{
54 OutColor.zxy += i.color;
55}
56
57void GetColor10(const S i, int comp)
58{
59 OutColor.zy += i.color.xy;
60}
61
62void GetColor11(const S i, int comp)
63{
64 OutColor.zxy.yx += i.color.xy;
65}
66
67void GetColor12(const S i, int comp)
68{
69 OutColor[comp] += i.color.x;
70}
71
72void GetColor13(const S i, int comp)
73{
Rex Xu64b97432016-09-14 14:43:21 +080074 OutColor.zy[comp] += i.color.x;
John Kessenich06e1d0b2015-05-22 21:57:58 +000075}
76
John Kessenich5c3eed52018-02-05 14:44:14 -070077void GetColor14(const S i, int comp)
78{
79 OutColor.zyx[comp] = i.color.x;
80}
81
John Kessenich06e1d0b2015-05-22 21:57:58 +000082void main()
83{
84 S s;
85 OutColor = vec3(0.0);
86 GetColor1(s);
87 GetColor2(s, u);
88 GetColor3(s, u);
89 GetColor4(s, u);
90 GetColor5(s, u);
91 GetColor6(s, u);
92 GetColor7(s, u);
93 GetColor8(s, u);
94 GetColor9(s, u);
95 GetColor10(s, u);
96 GetColor11(s, u);
97 GetColor12(s, u);
98 GetColor13(s, u);
John Kessenich5c3eed52018-02-05 14:44:14 -070099 GetColor14(s, u);
John Kessenich06e1d0b2015-05-22 21:57:58 +0000100}