Skip to content

Commit 7356181

Browse files
refactor(const_eval): inline math_pow
1 parent 0530389 commit 7356181

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
@@ -798,7 +798,11 @@ impl<'a> ConstantEvaluator<'a> {
798798
crate::MathFunction::Atanh => {
799799
component_wise_float!(self, span, [arg], |e| { e.atanh().into() })
800800
}
801-
crate::MathFunction::Pow => self.math_pow(arg, arg1.unwrap(), span),
801+
crate::MathFunction::Pow => {
802+
component_wise_float!(self, span, [arg, arg1.unwrap()], |e1, e2| {
803+
e1.powf(e2).into()
804+
})
805+
}
802806
crate::MathFunction::Clamp => {
803807
component_wise_scalar!(
804808
self,
@@ -845,15 +849,6 @@ impl<'a> ConstantEvaluator<'a> {
845849
}
846850
}
847851

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

0 commit comments

Comments
 (0)