skia2/resources/sksl/shared/CastsRoundTowardZero.sksl

10 lines
309 B
Plaintext
Raw Normal View History

uniform half4 colorGreen, colorRed;
half4 main(float2 coords) {
bool ok = true;
ok = ok && (half4(int4(0, 0, 1, 2)) == half4(int4(half4(0.01, 0.99, 1.49, 2.75))));
ok = ok && (half4(int4(0, 0, -1, -2)) == half4(int4(half4(-0.01, -0.99, -1.49, -2.75))));
return ok ? colorGreen : colorRed;
}