skia2/tests/sksl/intrinsics/Not.glsl
John Stiles 7bb100ec04 Optimize not() intrinsic.
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>
2021-05-11 14:08:39 +00:00

12 lines
471 B
GLSL

out vec4 sk_FragColor;
uniform vec4 inputH4;
uniform vec4 expectedH4;
uniform vec4 colorGreen;
uniform vec4 colorRed;
vec4 main() {
bvec4 input = bvec4(inputH4);
bvec4 expected = bvec4(expectedH4);
return ((((not(input.xy) == expected.xy && not(input.xyz) == expected.xyz) && not(input) == expected) && bvec2(false, true) == expected.xy) && bvec3(false, true, false) == expected.xyz) && bvec4(false, true, false, true) == expected ? colorGreen : colorRed;
}