mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Reuse YaProcessData object on the plugin side
Well, kind of. This doesn't do anything yet since the default assignment operator will just destroy and recreate objects as normal.
This commit is contained in:
@@ -186,12 +186,15 @@ Vst3PluginProxyImpl::process(Steinberg::Vst::ProcessData& data) {
|
||||
last_audio_thread_priority_synchronization = now;
|
||||
}
|
||||
|
||||
// TODO: Check whether reusing a `YaProcessData` object make a difference in
|
||||
// terms of performance
|
||||
// TODO: Document
|
||||
// TODO: Actually repopulate `process_data` with new data, right now this
|
||||
// assignment just destroys the old object and creates a new object.
|
||||
process_data = data;
|
||||
|
||||
ProcessResponse response =
|
||||
bridge.send_audio_processor_message(YaAudioProcessor::Process{
|
||||
.instance_id = instance_id(),
|
||||
.data = data,
|
||||
.data = process_data,
|
||||
.new_realtime_priority = new_realtime_priority});
|
||||
|
||||
response.output_data.write_back_outputs(data);
|
||||
|
||||
@@ -490,6 +490,12 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
|
||||
*/
|
||||
std::atomic_size_t current_context_menu_id;
|
||||
|
||||
/**
|
||||
* We'll reuse this process data object and simply fill the objects
|
||||
* contained with new data to avoid allocations during audio processing.
|
||||
*/
|
||||
YaProcessData process_data;
|
||||
|
||||
// Caches
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user