Skip to content

Commit

Permalink
feat(const_eval): impl. step
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Dec 14, 2023
1 parent 14338eb commit 596bef9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions naga/src/proc/constant_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,11 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::Sqrt => {
component_wise_float!(self, span, [arg], |e| { e.sqrt().into() })
}
crate::MathFunction::Step => {
component_wise_float!(self, span, [arg, arg1.unwrap()], |edge, x| {
if edge <= x { 1.0 } else { 0.0 }.into()
})
}
fun => Err(ConstantEvaluatorError::NotImplemented(format!(
"{fun:?} built-in function"
))),
Expand Down

0 comments on commit 596bef9

Please sign in to comment.