mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
feat(const_eval): impl. countOneBits
This commit is contained in:
parent
ea044f039c
commit
2ccc4f49ee
@ -69,6 +69,7 @@ Bottom level categories:
|
||||
- [#5098](https://github.com/gfx-rs/wgpu/pull/5098) by @ErichDonGubler:
|
||||
- `ceil`
|
||||
- `countLeadingZeros`
|
||||
- `countOneBits`
|
||||
- `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)
|
||||
|
@ -886,6 +886,15 @@ impl<'a> ConstantEvaluator<'a> {
|
||||
.expect("bit count overflowed 32 bits, somehow!?")])
|
||||
})
|
||||
}
|
||||
crate::MathFunction::CountOneBits => {
|
||||
component_wise_concrete_int!(self, span, [arg], |e| {
|
||||
#[allow(clippy::useless_conversion)]
|
||||
Ok([e
|
||||
.count_ones()
|
||||
.try_into()
|
||||
.expect("bit count overflowed 32 bits, somehow!?")])
|
||||
})
|
||||
}
|
||||
crate::MathFunction::Floor => {
|
||||
component_wise_float!(self, span, [arg], |e| { Ok([e.floor()]) })
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user