skia2/resources/sksl/intrinsics/Dot.sksl

18 lines
778 B
Plaintext
Raw Normal View History

uniform half4 inputA, inputB;
uniform half4 colorGreen, colorRed;
half4 main(float2 coords) {
const half4 constValA = half4(1, 2, 3, 4);
const half4 constValB = half4(5, 6, 7, 8);
half4 expected = half4(5, 17, 38, 70);
return (dot(inputA.x, inputB.x) == expected.x &&
dot(inputA.xy, inputB.xy) == expected.y &&
dot(inputA.xyz, inputB.xyz) == expected.z &&
dot(inputA.xyzw, inputB.xyzw) == expected.w &&
dot(constValA.x, constValB.x) == expected.x &&
dot(constValA.xy, constValB.xy) == expected.y &&
dot(constValA.xyz, constValB.xyz) == expected.z &&
dot(constValA.xyzw, constValB.xyzw) == expected.w) ? colorGreen : colorRed;
}