2021-03-25 21:04:36 +00:00
|
|
|
uniform half4 colorGreen;
|
2021-03-10 03:14:27 +00:00
|
|
|
|
2021-03-25 21:04:36 +00:00
|
|
|
noinline half4 multiplyByAlpha(half4 x) {
|
|
|
|
return x * x.aaaa;
|
2021-03-10 03:14:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
noinline half add(half a, half b) {
|
|
|
|
half c = a + b;
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
noinline half mul(half a, half b) {
|
|
|
|
return a * b;
|
|
|
|
}
|
|
|
|
|
|
|
|
noinline half fma(half a, half b, half c) {
|
|
|
|
return add(mul(a, b), c);
|
|
|
|
}
|
|
|
|
|
2021-04-21 18:27:08 +00:00
|
|
|
half4 main(float2 coords) {
|
2021-03-10 03:14:27 +00:00
|
|
|
// Functions used multiple times:
|
2021-03-25 21:04:36 +00:00
|
|
|
half4 result = fma(colorGreen.a, colorGreen.g, colorGreen.r).0x0x;
|
2021-03-10 03:14:27 +00:00
|
|
|
// Functions used only once:
|
2021-03-25 21:04:36 +00:00
|
|
|
result = multiplyByAlpha(result);
|
|
|
|
|
|
|
|
return result;
|
2021-03-10 03:14:27 +00:00
|
|
|
}
|