skia2/resources/sksl/intrinsics/Acosh.sksl
John Stiles 1049d82061 Add ES3 Angle and Trigonometry methods to sksl_public.
This adds sinh, cosh, tanh, asinh, acosh, and atanh. We now also support
compile-time optimization for the arc functions.

Change-Id: I688f579b50403db534622b82926aa20d1f445341
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439319
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-08-13 20:57:44 +00:00

15 lines
642 B
Plaintext

uniform half4 input, expected;
uniform half4 colorGreen, colorRed;
half4 main(float2 coords) {
const half4 constVal1 = half4(1, 1, 1.54308063481524377, 3.7621956910836314);
return (acosh(input.x) == expected.x &&
acosh(input.xy) == expected.xy &&
acosh(input.xyz) == expected.xyz &&
acosh(input.xyzw) == expected.xyzw &&
acosh(constVal1.x) == expected.x &&
acosh(constVal1.xy) == expected.xy &&
acosh(constVal1.xyz) == expected.xyz &&
acosh(constVal1.xyzw) == expected.xyzw) ? colorGreen : colorRed;
}