skia2/resources/sksl/intrinsics/Fract.sksl

11 lines
375 B
Plaintext
Raw Normal View History

uniform half4 testInputs;
uniform half4 colorGreen, colorRed;
half4 main() {
half4 expected = half4(0.75, 0, 0.75, 0.25);
return (fract(testInputs.x) == expected.x &&
fract(testInputs.xy) == expected.xy &&
fract(testInputs.xyz) == expected.xyz &&
fract(testInputs.xyzw) == expected.xyzw) ? colorGreen : colorRed;
}