Closed thargy closed 6 years ago
Degrees and Radians don't seem to have direct Metal functions for them, so we'll have to add manual implementations, unless I'm missing them somewhere.
You can see the code in the ShaderBuiltins
implementations, it’s pretty trivial (multiply/divide by a constant). I’ll implement in the morning if I get time. I won’t be able to test though, but should be easy enough.
Thanks for pushing the extra fix. Everything passes on my Mac now, so I'll go ahead and merge.
I had a few minutes so I added the remaining missing common built-in functions to
ShaderBuiltins
, they all turned out to be somewhat trivial, and the auto-generated tests made it incredibly quick to do!I've left each function in their own commits, as I couldn't test on Metal, however, I did check the functions existed on Metal and were equivalent according to the spec. so there should be no problems and you should feel free to squash the commits once tested on Metal.
The added functions are
Degrees
,Radians
,Exp2
,RSqrt
,Step
andSign
.