Skip to content

Commit 99c54f4

Browse files
refactor(const_eval): inline math_pow
1 parent af714c5 commit 99c54f4

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
@@ -808,7 +808,11 @@ impl<'a> ConstantEvaluator<'a> {
808808
crate::MathFunction::Atanh => {
809809
component_wise_float!(self, span, [arg], |e| { Ok(e.atanh().into()) })
810810
}
811-
crate::MathFunction::Pow => self.math_pow(arg, arg1.unwrap(), span),
811+
crate::MathFunction::Pow => {
812+
component_wise_float!(self, span, [arg, arg1.unwrap()], |e1, e2| {
813+
Ok(e1.powf(e2).into())
814+
})
815+
}
812816
crate::MathFunction::Clamp => {
813817
component_wise_scalar!(
814818
self,
@@ -884,15 +888,6 @@ impl<'a> ConstantEvaluator<'a> {
884888
}
885889
}
886890

887-
fn math_pow(
888-
&mut self,
889-
e1: Handle<Expression>,
890-
e2: Handle<Expression>,
891-
span: Span,
892-
) -> Result<Handle<Expression>, ConstantEvaluatorError> {
893-
component_wise_float!(self, span, [e1, e2], |e1, e2| { e1.powf(e2).into() })
894-
}
895-
896891
fn array_length(
897892
&mut self,
898893
array: Handle<Expression>,

0 commit comments

Comments
 (0)