2020-11-26 03:19:16 +00:00
|
|
|
|
|
|
|
out vec4 sk_FragColor;
|
2021-02-01 16:52:10 +00:00
|
|
|
uniform vec4 colorGreen;
|
|
|
|
uniform vec4 colorRed;
|
|
|
|
vec4 unpremul(vec4 color) {
|
|
|
|
return vec4(color.xyz / max(color.w, 9.9999997473787516e-05), color.w);
|
2020-11-26 03:19:16 +00:00
|
|
|
}
|
|
|
|
vec4 live_fn(vec4 a, vec4 b) {
|
|
|
|
return a + b;
|
|
|
|
}
|
2021-02-01 16:52:10 +00:00
|
|
|
vec4 main() {
|
|
|
|
vec4 a;
|
|
|
|
vec4 b;
|
|
|
|
|
2020-11-26 03:19:16 +00:00
|
|
|
{
|
2021-02-01 16:52:10 +00:00
|
|
|
a = live_fn(vec4(3.0), vec4(-5.0));
|
2020-11-26 03:19:16 +00:00
|
|
|
}
|
|
|
|
{
|
2021-02-01 16:52:10 +00:00
|
|
|
b = unpremul(vec4(1.0));
|
2020-11-26 03:19:16 +00:00
|
|
|
}
|
2021-02-01 16:52:10 +00:00
|
|
|
return a != vec4(0.0) && b != vec4(0.0) ? colorGreen : colorRed;
|
2020-11-26 03:19:16 +00:00
|
|
|
}
|