From 01d02caca3ede1237d3e2484fddab36fbfe677ee Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Fri, 5 Jan 2024 10:56:24 -0500 Subject: [PATCH] feat(const_eval): impl. `exp` --- CHANGELOG.md | 1 + naga/src/proc/constant_evaluator.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ceb886aa..04e4372cb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ Bottom level categories: - `countLeadingZeros` - `countOneBits` - `countTrailingZeros` + - `exp` - `floor` - 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) diff --git a/naga/src/proc/constant_evaluator.rs b/naga/src/proc/constant_evaluator.rs index ea8807d7b3..a97a6e6a53 100644 --- a/naga/src/proc/constant_evaluator.rs +++ b/naga/src/proc/constant_evaluator.rs @@ -904,6 +904,9 @@ impl<'a> ConstantEvaluator<'a> { .expect("bit count overflowed 32 bits, somehow!?")]) }) } + crate::MathFunction::Exp => { + component_wise_float!(self, span, [arg], |e| { Ok([e.exp()]) }) + } crate::MathFunction::Floor => { component_wise_float!(self, span, [arg], |e| { Ok([e.floor()]) }) }