• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*#pragma settings NoInline*/
2
3uniform half4 color;
4
5half singleuse() {
6    return 1.25;
7}
8
9half add(half a, half b) {
10    half c = a + b;
11    return c;
12}
13
14half mul(half a, half b) {
15    return a * b;
16}
17
18half fma(half a, half b, half c) {
19    return add(mul(a, b), c);
20}
21
22void main() {
23    // Functions used multiple times:
24    sk_FragColor = fma(color.x, color.y, color.z).xxxx;
25    // Functions used only once:
26    sk_FragColor *= singleuse();
27    // Intrinsic functions:
28    sk_FragColor *= blend_src_in(color.xxyy, color.zzww);
29    sk_FragColor *= blend_dst_in(color.xxyy, color.zzww);
30    sk_FragColor *= blend_hue(color, color.wwww);
31    sk_FragColor *= blend_hue(color, color.wzyx);
32}
33