feat(const_eval): impl. log

This commit is contained in:
Erich Gubler 2024-01-26 12:14:08 -05:00 committed by Teodor Tanasoaia
parent 4db02d1962
commit 39cb92cf88
2 changed files with 4 additions and 0 deletions

View File

@ -78,6 +78,7 @@ Bottom level categories:
- `fract`
- `fma`
- `inverseSqrt`
- `log`
- Eager release of GPU resources comes from device.trackers. By @bradwerth in [#5075](https://github.com/gfx-rs/wgpu/pull/5075)
- `wgpu-types`'s `trace` and `replay` features have been replaced by the `serde` feature. By @KirmesBude in [#5149](https://github.com/gfx-rs/wgpu/pull/5149)
- `wgpu-core`'s `serial-pass` feature has been removed. Use `serde` instead. By @KirmesBude in [#5149](https://github.com/gfx-rs/wgpu/pull/5149)

View File

@ -934,6 +934,9 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::InverseSqrt => {
component_wise_float!(self, span, [arg], |e| { Ok([1. / e.sqrt()]) })
}
crate::MathFunction::Log => {
component_wise_float!(self, span, [arg], |e| { Ok([e.ln()]) })
}
crate::MathFunction::Round => {
// TODO: Use `f{32,64}.round_ties_even()` when available on stable. This polyfill
// is shamelessly [~~stolen from~~ inspired by `ndarray-image`][polyfill source],