John Kessenich | 06e1d0b | 2015-05-22 21:57:58 +0000 | [diff] [blame] | 1 | #version 420
|
| 2 |
|
| 3 | struct S
|
| 4 | {
|
| 5 | vec3 color;
|
| 6 | };
|
| 7 |
|
| 8 | layout(location = 0) out vec3 OutColor;
|
| 9 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 10 | flat in int u;
|
John Kessenich | 06e1d0b | 2015-05-22 21:57:58 +0000 | [diff] [blame] | 11 |
|
| 12 | void GetColor1(const S i)
|
| 13 | {
|
| 14 | OutColor += i.color.x;
|
| 15 | }
|
| 16 |
|
| 17 | void GetColor2(const S i, int comp)
|
| 18 | {
|
| 19 | OutColor += i.color[comp];
|
| 20 | }
|
| 21 |
|
| 22 | void GetColor3(const S i, int comp)
|
| 23 | {
|
| 24 | OutColor += i.color[comp].x;
|
| 25 | }
|
| 26 |
|
| 27 | void GetColor4(const S i, int comp)
|
| 28 | {
|
| 29 | OutColor += i.color[comp].x;
|
| 30 | }
|
| 31 |
|
| 32 | void GetColor5(const S i, int comp)
|
| 33 | {
|
| 34 | OutColor += i.color;
|
| 35 | }
|
| 36 |
|
| 37 | void GetColor6(const S i, int comp)
|
| 38 | {
|
| 39 | OutColor += i.color.yx[comp];
|
| 40 | }
|
| 41 |
|
| 42 | void GetColor7(const S i, int comp)
|
| 43 | {
|
| 44 | OutColor.xy += i.color.yxz.yx;
|
| 45 | }
|
| 46 |
|
| 47 | void GetColor8(const S i, int comp)
|
| 48 | {
|
| 49 | OutColor += i.color.yzx.yx.x.x;
|
| 50 | }
|
| 51 |
|
| 52 | void GetColor9(const S i, int comp)
|
| 53 | {
|
| 54 | OutColor.zxy += i.color;
|
| 55 | }
|
| 56 |
|
| 57 | void GetColor10(const S i, int comp)
|
| 58 | {
|
| 59 | OutColor.zy += i.color.xy;
|
| 60 | }
|
| 61 |
|
| 62 | void GetColor11(const S i, int comp)
|
| 63 | {
|
| 64 | OutColor.zxy.yx += i.color.xy;
|
| 65 | }
|
| 66 |
|
| 67 | void GetColor12(const S i, int comp)
|
| 68 | {
|
| 69 | OutColor[comp] += i.color.x;
|
| 70 | }
|
| 71 |
|
| 72 | void GetColor13(const S i, int comp)
|
| 73 | {
|
Rex Xu | 64b9743 | 2016-09-14 14:43:21 +0800 | [diff] [blame] | 74 | OutColor.zy[comp] += i.color.x;
|
John Kessenich | 06e1d0b | 2015-05-22 21:57:58 +0000 | [diff] [blame] | 75 | }
|
| 76 |
|
John Kessenich | 5c3eed5 | 2018-02-05 14:44:14 -0700 | [diff] [blame] | 77 | void GetColor14(const S i, int comp)
|
| 78 | {
|
| 79 | OutColor.zyx[comp] = i.color.x;
|
| 80 | }
|
| 81 |
|
John Kessenich | 06e1d0b | 2015-05-22 21:57:58 +0000 | [diff] [blame] | 82 | void 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 Kessenich | 5c3eed5 | 2018-02-05 14:44:14 -0700 | [diff] [blame] | 99 | GetColor14(s, u);
|
John Kessenich | 06e1d0b | 2015-05-22 21:57:58 +0000 | [diff] [blame] | 100 | }
|