diff --git a/naga/src/proc/constant_evaluator.rs b/naga/src/proc/constant_evaluator.rs index db686ce9b15..5e6f19ada67 100644 --- a/naga/src/proc/constant_evaluator.rs +++ b/naga/src/proc/constant_evaluator.rs @@ -836,7 +836,11 @@ impl<'a> ConstantEvaluator<'a> { crate::MathFunction::Atanh => { component_wise_float!(self, span, [arg], |e| { Ok([e.atanh()]) }) } - crate::MathFunction::Pow => self.math_pow(arg, arg1.unwrap(), span), + crate::MathFunction::Pow => { + component_wise_float!(self, span, [arg, arg1.unwrap()], |e1, e2| { + Ok([e1.powf(e2)]) + }) + } crate::MathFunction::Clamp => { component_wise_scalar!( self, @@ -912,15 +916,6 @@ impl<'a> ConstantEvaluator<'a> { } } - fn math_pow( - &mut self, - e1: Handle, - e2: Handle, - span: Span, - ) -> Result, ConstantEvaluatorError> { - component_wise_float!(self, span, [e1, e2], |e1, e2| { Ok([e1.powf(e2)]) }) - } - fn array_length( &mut self, array: Handle,