summaryrefslogtreecommitdiffstats
path: root/src/audio_core/effect_context.cpp
diff options
context:
space:
mode:
authorChloe Marcec <dmarcecguzman@gmail.com>2021-02-11 08:46:20 +0100
committerbunnei <bunneidev@gmail.com>2021-02-13 03:48:10 +0100
commit4a7fd91857a95dd9ba7c838384671b2a83e46e7d (patch)
tree77dc77e963c2ce5e386d747b76ba19bec89a92b6 /src/audio_core/effect_context.cpp
parentMerge pull request #5877 from ameerj/res-limit-usage (diff)
downloadyuzu-4a7fd91857a95dd9ba7c838384671b2a83e46e7d.tar
yuzu-4a7fd91857a95dd9ba7c838384671b2a83e46e7d.tar.gz
yuzu-4a7fd91857a95dd9ba7c838384671b2a83e46e7d.tar.bz2
yuzu-4a7fd91857a95dd9ba7c838384671b2a83e46e7d.tar.lz
yuzu-4a7fd91857a95dd9ba7c838384671b2a83e46e7d.tar.xz
yuzu-4a7fd91857a95dd9ba7c838384671b2a83e46e7d.tar.zst
yuzu-4a7fd91857a95dd9ba7c838384671b2a83e46e7d.zip
Diffstat (limited to 'src/audio_core/effect_context.cpp')
-rw-r--r--src/audio_core/effect_context.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/audio_core/effect_context.cpp b/src/audio_core/effect_context.cpp
index f770b9608..eeee8e325 100644
--- a/src/audio_core/effect_context.cpp
+++ b/src/audio_core/effect_context.cpp
@@ -90,6 +90,14 @@ s32 EffectBase::GetProcessingOrder() const {
return processing_order;
}
+std::vector<u8>& EffectBase::GetWorkBuffer() {
+ return work_buffer;
+}
+
+const std::vector<u8>& EffectBase::GetWorkBuffer() const {
+ return work_buffer;
+}
+
EffectI3dl2Reverb::EffectI3dl2Reverb() : EffectGeneric(EffectType::I3dl2Reverb) {}
EffectI3dl2Reverb::~EffectI3dl2Reverb() = default;
@@ -117,6 +125,12 @@ void EffectI3dl2Reverb::Update(EffectInfo::InParams& in_params) {
usage = UsageState::Initialized;
params.status = ParameterStatus::Initialized;
skipped = in_params.buffer_address == 0 || in_params.buffer_size == 0;
+ if (!skipped) {
+ auto& work_buffer = GetWorkBuffer();
+ // Has two buffers internally
+ work_buffer.resize(in_params.buffer_size * 2);
+ std::fill(work_buffer.begin(), work_buffer.end(), 0);
+ }
}
}
@@ -129,6 +143,14 @@ void EffectI3dl2Reverb::UpdateForCommandGeneration() {
GetParams().status = ParameterStatus::Updated;
}
+I3dl2ReverbState& EffectI3dl2Reverb::GetState() {
+ return state;
+}
+
+const I3dl2ReverbState& EffectI3dl2Reverb::GetState() const {
+ return state;
+}
+
EffectBiquadFilter::EffectBiquadFilter() : EffectGeneric(EffectType::BiquadFilter) {}
EffectBiquadFilter::~EffectBiquadFilter() = default;