yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

Merge pull request #2169 from lioncash/naming

audio_core/audio_renderer: Provide names for some parameters of AudioRendererParameter
This commit is contained in:
bunnei 2019-02-27 11:26:54 -05:00 committed by GitHub
commit 42f7c11021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 19 deletions

View File

@ -46,16 +46,18 @@ struct AudioRendererParameter {
u32_le sample_rate; u32_le sample_rate;
u32_le sample_count; u32_le sample_count;
u32_le mix_buffer_count; u32_le mix_buffer_count;
u32_le unknown_c; u32_le submix_count;
u32_le voice_count; u32_le voice_count;
u32_le sink_count; u32_le sink_count;
u32_le effect_count; u32_le effect_count;
u32_le unknown_1c; u32_le performance_frame_count;
u8 unknown_20; u8 is_voice_drop_enabled;
INSERT_PADDING_BYTES(3); u8 unknown_21;
u8 unknown_22;
u8 execution_mode;
u32_le splitter_count; u32_le splitter_count;
u32_le unknown_2c; u32_le num_splitter_send_channels;
INSERT_PADDING_WORDS(1); u32_le unknown_30;
u32_le revision; u32_le revision;
}; };
static_assert(sizeof(AudioRendererParameter) == 52, "AudioRendererParameter is an invalid size"); static_assert(sizeof(AudioRendererParameter) == 52, "AudioRendererParameter is an invalid size");

View File

@ -262,20 +262,20 @@ void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_Audio, "called"); LOG_DEBUG(Service_Audio, "called");
u64 buffer_sz = Common::AlignUp(4 * params.mix_buffer_count, 0x40); u64 buffer_sz = Common::AlignUp(4 * params.mix_buffer_count, 0x40);
buffer_sz += params.unknown_c * 1024; buffer_sz += params.submix_count * 1024;
buffer_sz += 0x940 * (params.unknown_c + 1); buffer_sz += 0x940 * (params.submix_count + 1);
buffer_sz += 0x3F0 * params.voice_count; buffer_sz += 0x3F0 * params.voice_count;
buffer_sz += Common::AlignUp(8 * (params.unknown_c + 1), 0x10); buffer_sz += Common::AlignUp(8 * (params.submix_count + 1), 0x10);
buffer_sz += Common::AlignUp(8 * params.voice_count, 0x10); buffer_sz += Common::AlignUp(8 * params.voice_count, 0x10);
buffer_sz += buffer_sz += Common::AlignUp(
Common::AlignUp((0x3C0 * (params.sink_count + params.unknown_c) + 4 * params.sample_count) * (0x3C0 * (params.sink_count + params.submix_count) + 4 * params.sample_count) *
(params.mix_buffer_count + 6), (params.mix_buffer_count + 6),
0x40); 0x40);
if (IsFeatureSupported(AudioFeatures::Splitter, params.revision)) { if (IsFeatureSupported(AudioFeatures::Splitter, params.revision)) {
u32 count = params.unknown_c + 1; const u32 count = params.submix_count + 1;
u64 node_count = Common::AlignUp(count, 0x40); u64 node_count = Common::AlignUp(count, 0x40);
u64 node_state_buffer_sz = const u64 node_state_buffer_sz =
4 * (node_count * node_count) + 0xC * node_count + 2 * (node_count / 8); 4 * (node_count * node_count) + 0xC * node_count + 2 * (node_count / 8);
u64 edge_matrix_buffer_sz = 0; u64 edge_matrix_buffer_sz = 0;
node_count = Common::AlignUp(count * count, 0x40); node_count = Common::AlignUp(count * count, 0x40);
@ -289,19 +289,19 @@ void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
buffer_sz += 0x20 * (params.effect_count + 4 * params.voice_count) + 0x50; buffer_sz += 0x20 * (params.effect_count + 4 * params.voice_count) + 0x50;
if (IsFeatureSupported(AudioFeatures::Splitter, params.revision)) { if (IsFeatureSupported(AudioFeatures::Splitter, params.revision)) {
buffer_sz += 0xE0 * params.unknown_2c; buffer_sz += 0xE0 * params.num_splitter_send_channels;
buffer_sz += 0x20 * params.splitter_count; buffer_sz += 0x20 * params.splitter_count;
buffer_sz += Common::AlignUp(4 * params.unknown_2c, 0x10); buffer_sz += Common::AlignUp(4 * params.num_splitter_send_channels, 0x10);
} }
buffer_sz = Common::AlignUp(buffer_sz, 0x40) + 0x170 * params.sink_count; buffer_sz = Common::AlignUp(buffer_sz, 0x40) + 0x170 * params.sink_count;
u64 output_sz = buffer_sz + 0x280 * params.sink_count + 0x4B0 * params.effect_count + u64 output_sz = buffer_sz + 0x280 * params.sink_count + 0x4B0 * params.effect_count +
((params.voice_count * 256) | 0x40); ((params.voice_count * 256) | 0x40);
if (params.unknown_1c >= 1) { if (params.performance_frame_count >= 1) {
output_sz = Common::AlignUp(((16 * params.sink_count + 16 * params.effect_count + output_sz = Common::AlignUp(((16 * params.sink_count + 16 * params.effect_count +
16 * params.voice_count + 16) + 16 * params.voice_count + 16) +
0x658) * 0x658) *
(params.unknown_1c + 1) + (params.performance_frame_count + 1) +
0xc0, 0xc0,
0x40) + 0x40) +
output_sz; output_sz;