mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
No longer zero out VST3 audio buffers
Apparently we also never did this for VST2 plugins, so this should be safe. Filling the vectors with zeroes here had a non-negligible performance impact according to perf.
This commit is contained in:
@@ -39,6 +39,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
unions yabridge uses to differentiate between single and double precision
|
||||
floating point audio buffers, undoing all of our efforts at reusing objects
|
||||
and preventing memory allocations in the process.
|
||||
- VST3 output audio buffers are no longer zeroed out for the plugin. We did this
|
||||
for VST3 plugins, but not for VST2 plugins. Since not doing this never caused
|
||||
any issues with VST2 plugins it should also be safe to do the same thing for
|
||||
VST3 plugins. This further reduces the overhead of VST3 audio processing.
|
||||
- Further optimized VST3 audio processing by preallocating small vectors for
|
||||
event and parameter change queues.
|
||||
- VST2 audio processing also received the same small vector optimization to get
|
||||
|
||||
@@ -33,7 +33,7 @@ void YaAudioBusBuffers::clear(int32 sample_size,
|
||||
std::get<std::vector<std::vector<double>>>(buffers);
|
||||
vector_buffers.resize(num_channels);
|
||||
for (size_t i = 0; i < vector_buffers.size(); i++) {
|
||||
vector_buffers[i].assign(num_samples, 0.0);
|
||||
vector_buffers[i].resize(num_samples);
|
||||
}
|
||||
} else {
|
||||
if (!std::holds_alternative<std::vector<std::vector<float>>>(buffers)) {
|
||||
@@ -44,7 +44,7 @@ void YaAudioBusBuffers::clear(int32 sample_size,
|
||||
std::get<std::vector<std::vector<float>>>(buffers);
|
||||
vector_buffers.resize(num_channels);
|
||||
for (size_t i = 0; i < vector_buffers.size(); i++) {
|
||||
vector_buffers[i].assign(num_samples, 0.0f);
|
||||
vector_buffers[i].resize(num_samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user