mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
feat(const_eval): impl. step
This commit is contained in:
1 parent
f2dbdfcdc6
commit
6f5b2a64e2
2 files changed
+6
No files matched your search
@@ -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"
|
||||
))),
|
||||
|
||||
Reference in new issue
Block a user