summaryrefslogtreecommitdiff
path: root/src/audio_core/renderer/system.cpp
diff options
context:
space:
mode:
authorGravatar Kelebek12023-09-16 20:48:45 +0100
committerGravatar Kelebek12023-09-18 10:38:14 +0100
commit5d7571114e2621eeda85d3c4784b9dd5df2f8853 (patch)
tree4053f4c0e98772f352241db4de2de3287fcdb6b2 /src/audio_core/renderer/system.cpp
parentMerge pull request #11519 from german77/system-policy (diff)
downloadyuzu-5d7571114e2621eeda85d3c4784b9dd5df2f8853.tar.gz
yuzu-5d7571114e2621eeda85d3c4784b9dd5df2f8853.tar.xz
yuzu-5d7571114e2621eeda85d3c4784b9dd5df2f8853.zip
Do not consider voice commands in time estimation, fix adpcm estimate
Diffstat (limited to 'src/audio_core/renderer/system.cpp')
-rw-r--r--src/audio_core/renderer/system.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp
index d29754634..31f92087c 100644
--- a/src/audio_core/renderer/system.cpp
+++ b/src/audio_core/renderer/system.cpp
@@ -684,11 +684,11 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer,
684 sink_context, splitter_context, perf_manager}; 684 sink_context, splitter_context, perf_manager};
685 685
686 voice_context.SortInfo(); 686 voice_context.SortInfo();
687 command_generator.GenerateVoiceCommands();
687 688
688 const auto start_estimated_time{drop_voice_param * 689 const auto start_estimated_time{drop_voice_param *
689 static_cast<f32>(command_buffer.estimated_process_time)}; 690 static_cast<f32>(command_buffer.estimated_process_time)};
690 691
691 command_generator.GenerateVoiceCommands();
692 command_generator.GenerateSubMixCommands(); 692 command_generator.GenerateSubMixCommands();
693 command_generator.GenerateFinalMixCommands(); 693 command_generator.GenerateFinalMixCommands();
694 command_generator.GenerateSinkCommands(); 694 command_generator.GenerateSinkCommands();
@@ -708,11 +708,13 @@ u64 System::GenerateCommand(std::span<u8> in_command_buffer,
708 708
709 const auto end_estimated_time{drop_voice_param * 709 const auto end_estimated_time{drop_voice_param *
710 static_cast<f32>(command_buffer.estimated_process_time)}; 710 static_cast<f32>(command_buffer.estimated_process_time)};
711
712 const auto dsp_time_limit{((time_limit_percent / 100.0f) * 2'880'000.0f) *
713 (static_cast<f32>(render_time_limit_percent) / 100.0f)};
714
711 const auto estimated_time{start_estimated_time - end_estimated_time}; 715 const auto estimated_time{start_estimated_time - end_estimated_time};
712 716
713 const auto time_limit{static_cast<u32>( 717 const auto time_limit{static_cast<u32>(std::max(dsp_time_limit + estimated_time, 0.0f))};
714 estimated_time + (((time_limit_percent / 100.0f) * 2'880'000.0) *
715 (static_cast<f32>(render_time_limit_percent) / 100.0f)))};
716 num_voices_dropped = 718 num_voices_dropped =
717 DropVoices(command_buffer, static_cast<u32>(start_estimated_time), time_limit); 719 DropVoices(command_buffer, static_cast<u32>(start_estimated_time), time_limit);
718 } 720 }