yuzu-emu
/
yuzu
Archived
1
0
Fork 0

Merge pull request #11735 from Kelebek1/clear_command_buffer_post_dsp

Clear DSP buffer after each execution
This commit is contained in:
liamwhite 2023-10-11 09:24:16 -04:00 committed by GitHub
commit 5ecdcfa334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -77,6 +77,7 @@ void AudioRenderer::Wait() {
"{}, got {}", "{}, got {}",
Message::RenderResponse, msg); Message::RenderResponse, msg);
} }
PostDSPClearCommandBuffer();
} }
void AudioRenderer::Send(Direction dir, u32 message) { void AudioRenderer::Send(Direction dir, u32 message) {
@ -96,6 +97,14 @@ void AudioRenderer::SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u
command_buffers[session_id].reset_buffer = reset; command_buffers[session_id].reset_buffer = reset;
} }
void AudioRenderer::PostDSPClearCommandBuffer() noexcept {
for (auto& buffer : command_buffers) {
buffer.buffer = 0;
buffer.size = 0;
buffer.reset_buffer = false;
}
}
u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept { u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept {
return command_buffers[session_id].remaining_command_count; return command_buffers[session_id].remaining_command_count;
} }

View File

@ -85,6 +85,8 @@ private:
*/ */
void CreateSinkStreams(); void CreateSinkStreams();
void PostDSPClearCommandBuffer() noexcept;
/// Core system /// Core system
Core::System& system; Core::System& system;
/// The output sink the AudioRenderer will send samples to /// The output sink the AudioRenderer will send samples to