|
|
* Support Metal math functions
Closes #4024
Note that Metal document says Metal doesn't support "double" type;
"Metal does not support the double, long long, unsigned long long,
and long double data types."
According to Metal document, math functions are not defined for
integer types.
That leaves only two types to test: half and float.
As a code clean up, __floatCast is replaced with __realCast.
But I had to add a new signature that can convert from integer to
float.
Some of GLSL functions are moved to hlsl.meta.slang.
For those functions, there isn't builtin functions for HLSL but
there are for GLSL and Metal.
"nextafter(T,T)" is currently not working because it requires Metal
version 3.1 and we invoke metal compiler with a profile version
lower than 3.1.
* Changes based on review comments.
|