skia2/tests/sksl/intrinsics/Mod.glsl
John Stiles f06aeedcf1 Add intrinsic tests for mod() and fract().
These are fully supported by ES2 and will be covered by dm tests.

Change-Id: Iebf4effe8ab928662b55c0bb5b09e8b2a61487ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362460
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-01-29 21:51:54 +00:00

11 lines
621 B
GLSL

out vec4 sk_FragColor;
uniform vec4 testInputs;
uniform vec4 colorGreen;
uniform vec4 colorRed;
uniform vec4 colorWhite;
vec4 main() {
vec4 vector2 = 2.0 * colorWhite;
return ((((((mod(testInputs.x, 2.0) == 0.75 && mod(testInputs.xy, 2.0) == vec2(0.75, 0.0)) && mod(testInputs.xyz, 2.0) == vec3(0.75, 0.0, 0.75)) && mod(testInputs, 2.0) == vec4(0.75, 0.0, 0.75, 0.25)) && mod(testInputs.x, vector2.x) == 0.75) && mod(testInputs.xy, vector2.xy) == vec2(0.75, 0.0)) && mod(testInputs.xyz, vector2.xyz) == vec3(0.75, 0.0, 0.75)) && mod(testInputs, vector2) == vec4(0.75, 0.0, 0.75, 0.25) ? colorGreen : colorRed;
}