Use the new SIMD helpers in Diopser
This commit is contained in:
parent
33905e5bc2
commit
161d86ab49
|
@ -11,7 +11,7 @@ crate-type = ["cdylib"]
|
|||
[features]
|
||||
default = ["simd"]
|
||||
# Make it go fast, vroom. Requires a nightly compiler.
|
||||
simd = []
|
||||
simd = ["nih_plug/simd"]
|
||||
|
||||
[dependencies]
|
||||
nih_plug = { path = "../../", features = ["assert_process_allocs"] }
|
||||
|
|
|
@ -284,10 +284,7 @@ impl Plugin for Diopser {
|
|||
// supports steroo audio.
|
||||
#[cfg(feature = "simd")]
|
||||
{
|
||||
let mut samples = f32x2::from_array([
|
||||
*unsafe { channel_samples.get_unchecked_mut(0) },
|
||||
*unsafe { channel_samples.get_unchecked_mut(1) },
|
||||
]);
|
||||
let mut samples = unsafe { channel_samples.to_simd_unchecked() };
|
||||
|
||||
for filter in self
|
||||
.filters
|
||||
|
@ -297,8 +294,7 @@ impl Plugin for Diopser {
|
|||
samples = filter.process(samples);
|
||||
}
|
||||
|
||||
*unsafe { channel_samples.get_unchecked_mut(0) } = samples.as_array()[0];
|
||||
*unsafe { channel_samples.get_unchecked_mut(1) } = samples.as_array()[1];
|
||||
unsafe { channel_samples.from_simd_unchecked(samples) };
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "simd"))]
|
||||
|
|
Loading…
Reference in a new issue