diff --git a/CHANGELOG.md b/CHANGELOG.md index 80704dc27..ff937bbdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/naga/src/proc/constant_evaluator.rs b/naga/src/proc/constant_evaluator.rs index 4692355a5..b56d4c699 100644 --- a/naga/src/proc/constant_evaluator.rs +++ b/naga/src/proc/constant_evaluator.rs @@ -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!(