Skip to content

Commit af20cb3

Browse files
refactor(const_eval): inline math_pow
1 parent a0c9e26 commit af20cb3

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
@@ -837,7 +837,11 @@ impl<'a> ConstantEvaluator<'a> {
837837
crate::MathFunction::Atanh => {
838838
component_wise_float!(self, span, [arg], |e| { Ok([e.atanh()]) })
839839
}
840-
crate::MathFunction::Pow => self.math_pow(arg, arg1.unwrap(), span),
840+
crate::MathFunction::Pow => {
841+
component_wise_float!(self, span, [arg, arg1.unwrap()], |e1, e2| {
842+
Ok([e1.powf(e2)])
843+
})
844+
}
841845
crate::MathFunction::Clamp => {
842846
component_wise_scalar!(
843847
self,
@@ -913,15 +917,6 @@ impl<'a> ConstantEvaluator<'a> {
913917
}
914918
}
915919

916-
fn math_pow(
917-
&mut self,
918-
e1: Handle<Expression>,
919-
e2: Handle<Expression>,
920-
span: Span,
921-
) -> Result<Handle<Expression>, ConstantEvaluatorError> {
922-
component_wise_float!(self, span, [e1, e2], |e1, e2| { Ok([e1.powf(e2)]) })
923-
}
924-
925920
fn array_length(
926921
&mut self,
927922
array: Handle<Expression>,

0 commit comments

Comments
 (0)