mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
refactor(const_eval): inline math_pow
This commit is contained in:
1 parent
c2f110ed0c
commit
063e11027b
1 file changed
+5
-10
@@ -837,7 +837,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,
|
||||
@@ -913,15 +917,6 @@ impl<'a> ConstantEvaluator<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn math_pow(
|
||||
&mut self,
|
||||
e1: Handle<Expression>,
|
||||
e2: Handle<Expression>,
|
||||
span: Span,
|
||||
) -> Result<Handle<Expression>, ConstantEvaluatorError> {
|
||||
component_wise_float!(self, span, [e1, e2], |e1, e2| { Ok([e1.powf(e2)]) })
|
||||
}
|
||||
|
||||
fn array_length(
|
||||
&mut self,
|
||||
array: Handle<Expression>,
|
||||
|
||||
Reference in new issue
Block a user