feat(const_eval): impl. acos

This commit is contained in:
Erich Gubler 2023-12-22 08:01:52 -05:00
parent 12b11f870b
commit 6654c68950
2 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,7 @@ Bottom level categories:
- Many numeric built-ins have had a constant evaluation implementation added for them, which allows them to be used in a `const` context:
- [#4879](https://github.com/gfx-rs/wgpu/pull/4879) by @ErichDonGubler:
- `abs`
- `acos`
- `cos`
- `cosh`
- `round`

View File

@ -819,6 +819,9 @@ impl<'a> ConstantEvaluator<'a> {
Scalar::U32([e]) => Ok(Scalar::U32([e])), // TODO: just re-use the expression, ezpz
})
}
crate::MathFunction::Acos => {
component_wise_float!(self, span, [arg], |e| { Ok([e.acos()]) })
}
crate::MathFunction::Pow => self.math_pow(arg, arg1.unwrap(), span),
crate::MathFunction::Clamp => {
component_wise_scalar!(