skia2/resources/sksl/shared/ConstVariableComparison.sksl
John Stiles 6831635373 Cleanup TODO for constant-expression handling.
Support for constant-expression function calls in SkSL now exists, and
support for abs() was added at http://review.skia.org/405676.

Change-Id: I3144af993db93a3d640971734d4cb03e0cfb8589
Bug: skia:10835
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408642
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-14 13:36:33 +00:00

13 lines
247 B
Plaintext

uniform half4 colorGreen, colorRed;
half4 main(float2 coords) {
const float4 a = float4(0);
const float4 b = float4(1);
const float4 c = abs(b * 1);
if (a == b || b != c) {
return colorRed;
} else {
return colorGreen;
}
}