From d48aac685ecd47a80e0752011a1d78bc86094947 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 9 Feb 2026 11:39:54 +0100 Subject: Refactor Effect class to centralize common uniforms management Moved to Effect base class. Updated all subclasses to use the base member, removing redundant declarations and initializations. Cleaned up by removing redundant class definitions and including specific headers. Fixed a typo in DistortEffect constructor. --- src/gpu/effects/theme_modulation_effect.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gpu/effects/theme_modulation_effect.cc') diff --git a/src/gpu/effects/theme_modulation_effect.cc b/src/gpu/effects/theme_modulation_effect.cc index 7c222aa..b1eff90 100644 --- a/src/gpu/effects/theme_modulation_effect.cc +++ b/src/gpu/effects/theme_modulation_effect.cc @@ -67,14 +67,13 @@ ThemeModulationEffect::ThemeModulationEffect(const GpuContext& ctx) pipeline_ = create_post_process_pipeline(ctx_.device, ctx_.format, shader_code); - common_uniforms_.init(ctx_.device); params_buffer_ = gpu_create_buffer( ctx_.device, 16, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); } void ThemeModulationEffect::update_bind_group(WGPUTextureView input_view) { pp_update_bind_group(ctx_.device, pipeline_, &bind_group_, input_view, - common_uniforms_.get(), params_buffer_); + uniforms_.get(), params_buffer_); } void ThemeModulationEffect::render(WGPURenderPassEncoder pass, float time, @@ -87,7 +86,7 @@ void ThemeModulationEffect::render(WGPURenderPassEncoder pass, float time, .beat = beat, .audio_intensity = intensity, }; - common_uniforms_.update(ctx_.queue, u); + uniforms_.update(ctx_.queue, u); // Alternate between bright and dark every 4 seconds (2 pattern changes) // Music patterns change every 2 seconds at 120 BPM -- cgit v1.2.3