xref: /third_party/skia/resources/sksl/intrinsics/Sqrt.sksl (revision cb93a386)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/skia/resources/sksl/intrinsics/
1cb93a386Sopenharmony_ciuniform half4 inputVal, expected;
2cb93a386Sopenharmony_ciuniform half4 colorGreen, colorRed;
3cb93a386Sopenharmony_ci
4cb93a386Sopenharmony_cihalf4 main(float2 coords) {
5cb93a386Sopenharmony_ci    const half4 constVal = half4(1, 4, 16, 64);
6cb93a386Sopenharmony_ci    const half4 negativeVal = half4(-1, -4, -16, -64);  // should not optimize away
7cb93a386Sopenharmony_ci    return (sqrt(inputVal.x)       == expected.x     &&
8cb93a386Sopenharmony_ci            sqrt(inputVal.xy)      == expected.xy    &&
9cb93a386Sopenharmony_ci            sqrt(inputVal.xyz)     == expected.xyz   &&
10cb93a386Sopenharmony_ci            sqrt(inputVal.xyzw)    == expected.xyzw  &&
11cb93a386Sopenharmony_ci            sqrt(constVal.x)       == expected.x     &&
12cb93a386Sopenharmony_ci            sqrt(constVal.xy)      == expected.xy    &&
13cb93a386Sopenharmony_ci            sqrt(constVal.xyz)     == expected.xyz   &&
14cb93a386Sopenharmony_ci            sqrt(constVal.xyzw)    == expected.xyzw  &&
15cb93a386Sopenharmony_ci            sqrt(negativeVal.x)    == expected.x     &&
16cb93a386Sopenharmony_ci            sqrt(negativeVal.xy)   == expected.xy    &&
17cb93a386Sopenharmony_ci            sqrt(negativeVal.xyz)  == expected.xyz   &&
18cb93a386Sopenharmony_ci            sqrt(negativeVal.xyzw) == expected.xyzw) ? colorGreen : colorRed;
19cb93a386Sopenharmony_ci}
20

Indexes created Thu Nov 07 10:32:03 CST 2024