xref: /aosp_15_r20/external/skia/resources/sksl/shared/NestedComparisonIntrinsics.sksl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1uniform half4 colorRed, colorGreen;
2
3half4 main(float2 coords) {
4    // The inner comparisons against colors should evaluate to true in every component.
5    // The outer comparison should evaluate to `true == true`, so is true in each channel.
6    bool4 result = equal(lessThan(colorRed, half4(2.0)),
7                         greaterThan(half4(3.0), colorGreen));
8
9    return all(result) ? colorGreen : colorRed;
10}
11