Skip to content

Commit 7b7a115

Browse files
refactor(const_eval): inline math_pow
1 parent e66035b commit 7b7a115

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

naga/src/proc/constant_evaluator.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,11 @@ impl<'a> ConstantEvaluator<'a> {
797797
crate::MathFunction::Atanh => {
798798
component_wise_float!(self, span, [arg], |e| { e.atanh().into() })
799799
}
800-
crate::MathFunction::Pow => self.math_pow(arg, arg1.unwrap(), span),
800+
crate::MathFunction::Pow => {
801+
component_wise_float!(self, span, [arg, arg1.unwrap()], |e1, e2| {
802+
e1.powf(e2).into()
803+
})
804+
}
801805
crate::MathFunction::Clamp => {
802806
component_wise_scalar!(
803807
self,
@@ -844,15 +848,6 @@ impl<'a> ConstantEvaluator<'a> {
844848
}
845849
}
846850

847-
fn math_pow(
848-
&mut self,
849-
e1: Handle<Expression>,
850-
e2: Handle<Expression>,
851-
span: Span,
852-
) -> Result<Handle<Expression>, ConstantEvaluatorError> {
853-
component_wise_float!(self, span, [e1, e2], |e1, e2| { e1.powf(e2).into() })
854-
}
855-
856851
fn array_length(
857852
&mut self,
858853
array: Handle<Expression>,

0 commit comments

Comments
 (0)