1#version 420 2 3struct S 4{ 5 vec3 color; 6}; 7 8layout(location = 0) out vec3 OutColor; 9 10flat in int u; 11 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{ 74 OutColor.zy[comp] += i.color.x; 75} 76 77void GetColor14(const S i, int comp) 78{ 79 OutColor.zyx[comp] = i.color.x; 80} 81 82void 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); 99 GetColor14(s, u); 100} 101