mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 00:33:51 +00:00
feat(const_eval): impl. step
This commit is contained in:
parent
f2dbdfcdc6
commit
6f5b2a64e2
@ -49,6 +49,7 @@ Bottom level categories:
|
||||
- `sin`
|
||||
- `sinh`
|
||||
- `sqrt`
|
||||
- `step`
|
||||
|
||||
## v0.19.0 (2024-01-17)
|
||||
|
||||
|
@ -859,6 +859,11 @@ impl<'a> ConstantEvaluator<'a> {
|
||||
crate::MathFunction::Sqrt => {
|
||||
component_wise_float!(self, span, [arg], |e| { Ok([e.sqrt()]) })
|
||||
}
|
||||
crate::MathFunction::Step => {
|
||||
component_wise_float!(self, span, [arg, arg1.unwrap()], |edge, x| {
|
||||
Ok([if edge <= x { 1.0 } else { 0.0 }])
|
||||
})
|
||||
}
|
||||
fun => Err(ConstantEvaluatorError::NotImplemented(format!(
|
||||
"{fun:?} built-in function"
|
||||
))),
|
||||
|
Loading…
Reference in New Issue
Block a user