implemented minor audio keyframing optimization

Since updating all input values per sample could be performance costly,
we now only update inputs that are either keyframing or connected to
another node
This commit is contained in:
itsmattkc
2019-12-30 20:17:02 +11:00
parent e6c47b14f4
commit 55ea4a8177
+5 -2
View File
@@ -49,8 +49,11 @@ void AudioWorker::RunNodeAccelerated(const Node *node, const TimeRange &range, c
&& param != node->ProcessesSamplesFrom()) {
NodeInput* input = static_cast<NodeInput*>(param);
input_params.Insert(input, ProcessInput(input,
TimeRange(this_sample_time, this_sample_time)));
// If the input isn't keyframing, we don't need to update it unless it's connected, in which case it may change
if (input->IsConnected() || input->is_keyframing()) {
input_params.Insert(input, ProcessInput(input,
TimeRange(this_sample_time, this_sample_time)));
}
}
}