mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
feat(const_eval): impl. fract
This commit is contained in:
parent
fc04518750
commit
4db02d1962
@ -75,6 +75,7 @@ Bottom level categories:
|
||||
- `exp`
|
||||
- `exp2`
|
||||
- `floor`
|
||||
- `fract`
|
||||
- `fma`
|
||||
- `inverseSqrt`
|
||||
- Eager release of GPU resources comes from device.trackers. By @bradwerth in [#5075](https://github.com/gfx-rs/wgpu/pull/5075)
|
||||
|
@ -916,6 +916,13 @@ impl<'a> ConstantEvaluator<'a> {
|
||||
crate::MathFunction::Floor => {
|
||||
component_wise_float!(self, span, [arg], |e| { Ok([e.floor()]) })
|
||||
}
|
||||
crate::MathFunction::Fract => {
|
||||
component_wise_float!(self, span, [arg], |e| {
|
||||
// N.B., Rust's definition of `fract` is `e - e.trunc()`, so we can't use that
|
||||
// here.
|
||||
Ok([e - e.floor()])
|
||||
})
|
||||
}
|
||||
crate::MathFunction::Fma => {
|
||||
component_wise_float!(
|
||||
self,
|
||||
|
Loading…
Reference in New Issue
Block a user