skia2/resources/sksl/shared/ConstVariableComparison.sksl

15 lines
378 B
Plaintext
Raw Normal View History

uniform half4 colorGreen, colorRed;
half4 main() {
const float4 a = float4(0);
const float4 b = float4(1);
// This is a constant-expression in GLSL, but not in SkSL (yet).
// We can't declare this const, and we can't eliminate it. skbug.com/10835
/*const*/ float4 c = abs(b);
if (a == b || b != c) {
return colorRed;
} else {
return colorGreen;
}
}