7bb100ec04
This is similar to the intrinsic optimization for any() and all(). Tests for all three intrinsics have been bulked up a bit as well. Change-Id: I262b9448e543b4709d1e7c8585f74a206c4b5abd Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406576 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
15 lines
548 B
Plaintext
15 lines
548 B
Plaintext
uniform half4 inputH4, expectedH4;
|
|
uniform half4 colorGreen, colorRed;
|
|
|
|
half4 main(float2 coords) {
|
|
bool4 input = bool4(inputH4);
|
|
bool4 expected = bool4(expectedH4);
|
|
const bool4 constVal = bool4(false, false, true, false);
|
|
return (any(input.xy) == expected.x &&
|
|
any(input.xyz) == expected.y &&
|
|
any(input.xyzw) == expected.z &&
|
|
any(constVal.xy) == expected.x &&
|
|
any(constVal.xyz) == expected.y &&
|
|
any(constVal.xyzw) == expected.z) ? colorGreen : colorRed;
|
|
}
|