xref: /aosp_15_r20/external/skia/resources/sksl/workarounds/BuiltinFMASupport.sksl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1/*#pragma settings NoBuiltinFMASupport*/
2
3uniform half4 colorGreen, colorRed;
4uniform float testArray[5];
5
6half4 main(float2 coords) {
7    float one = testArray[0];
8    float two = testArray[1];
9    float three = testArray[2];
10    half four = half(testArray[3]);
11    half five = half(testArray[4]);
12
13    return (fma(one, two, three)         == (1 * 2 + 3)) &&
14           (fma(half(three), four, five) == (3 * 4 + 5)) &&
15           (fma(6, 7, 8)                 == (6 * 7 + 8)) ? colorGreen : colorRed;
16}
17