94e72b90b8
SkVMCodeGenerator was lacking support for the comma operator entirely; this has now been implemented. Change-Id: I9350f54e6ee52764c620116e6dbfe4ca3e9cd47e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363096 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
26 lines
549 B
Plaintext
26 lines
549 B
Plaintext
/*#pragma settings NoInline*/
|
|
|
|
uniform half4 colorRed, colorGreen, colorWhite, colorBlack;
|
|
|
|
void setToColorBlack(out half4 x) {
|
|
x = colorBlack;
|
|
}
|
|
|
|
half4 main() {
|
|
half4 a, b, c, d;
|
|
|
|
(b = colorRed), (c = colorGreen);
|
|
a = (setToColorBlack(d), colorWhite);
|
|
|
|
// These uniforms only contain 1s and 0s so these multiplies should be no-ops.
|
|
a *= a;
|
|
b *= b;
|
|
c *= c;
|
|
d *= d;
|
|
|
|
return (a == colorWhite &&
|
|
b == colorRed &&
|
|
c == colorGreen &&
|
|
d == colorBlack) ? colorGreen : colorRed;
|
|
}
|