mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-10-30 05:51:42 +00:00
feat(const_eval): impl. saturate
This commit is contained in:
parent
87dafb645a
commit
5dc1038124
@ -45,6 +45,7 @@ Bottom level categories:
|
||||
- [#4879](https://github.com/gfx-rs/wgpu/pull/4879) by @ErichDonGubler:
|
||||
- `abs`
|
||||
- `round`
|
||||
- `saturate`
|
||||
|
||||
## v0.19.0 (2024-01-17)
|
||||
|
||||
|
@ -847,6 +847,9 @@ impl<'a> ConstantEvaluator<'a> {
|
||||
Float::F32([e]) => Ok(Float::F32([(round_ties_even(e as f64) as f32)])),
|
||||
})
|
||||
}
|
||||
crate::MathFunction::Saturate => {
|
||||
component_wise_float!(self, span, [arg], |e| { Ok([e.clamp(0., 1.)]) })
|
||||
}
|
||||
fun => Err(ConstantEvaluatorError::NotImplemented(format!(
|
||||
"{fun:?} built-in function"
|
||||
))),
|
||||
|
Loading…
Reference in New Issue
Block a user