summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-11-25 18:53:29 +0100
committerGitHub <noreply@github.com>2022-11-25 18:53:29 +0100
commite16d1b85f1ba52955e67f6832f15499f230f3f31 (patch)
tree3c864bce66d9f37bea092a72204ab737fbc80b67 /src
parentMerge pull request #9302 from liamwhite/why-are-we-still-using-ado (diff)
parentUse the maximum input index for samples buffer span size, not just the input count (diff)
downloadyuzu-e16d1b85f1ba52955e67f6832f15499f230f3f31.tar
yuzu-e16d1b85f1ba52955e67f6832f15499f230f3f31.tar.gz
yuzu-e16d1b85f1ba52955e67f6832f15499f230f3f31.tar.bz2
yuzu-e16d1b85f1ba52955e67f6832f15499f230f3f31.tar.lz
yuzu-e16d1b85f1ba52955e67f6832f15499f230f3f31.tar.xz
yuzu-e16d1b85f1ba52955e67f6832f15499f230f3f31.tar.zst
yuzu-e16d1b85f1ba52955e67f6832f15499f230f3f31.zip
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/renderer/command/command_buffer.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/audio_core/renderer/command/command_buffer.cpp b/src/audio_core/renderer/command/command_buffer.cpp
index 2ef879ee1..8c6fe97e7 100644
--- a/src/audio_core/renderer/command/command_buffer.cpp
+++ b/src/audio_core/renderer/command/command_buffer.cpp
@@ -460,21 +460,23 @@ void CommandBuffer::GenerateDeviceSinkCommand(const s32 node_id, const s16 buffe
cmd.session_id = session_id;
+ cmd.input_count = parameter.input_count;
+ s16 max_input{0};
+ for (u32 i = 0; i < parameter.input_count; i++) {
+ cmd.inputs[i] = buffer_offset + parameter.inputs[i];
+ max_input = std::max(max_input, cmd.inputs[i]);
+ }
+
if (state.upsampler_info != nullptr) {
const auto size_{state.upsampler_info->sample_count * parameter.input_count};
const auto size_bytes{size_ * sizeof(s32)};
const auto addr{memory_pool->Translate(state.upsampler_info->samples_pos, size_bytes)};
cmd.sample_buffer = {reinterpret_cast<s32*>(addr),
- parameter.input_count * state.upsampler_info->sample_count};
+ (max_input + 1) * state.upsampler_info->sample_count};
} else {
cmd.sample_buffer = samples_buffer;
}
- cmd.input_count = parameter.input_count;
- for (u32 i = 0; i < parameter.input_count; i++) {
- cmd.inputs[i] = buffer_offset + parameter.inputs[i];
- }
-
GenerateEnd<DeviceSinkCommand>(cmd);
}