From bdb1a4e95a545f3f4d88630b8aec6ab771776d99 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 17 Feb 2026 13:05:11 +0100 Subject: refactor(effects): Streamline uniforms initialization Centralized uniforms_buffer_ initialization and updates to Effect base class: - init_uniforms_buffer() now automatic in Effect::Effect() - uniforms_buffer_.update() now automatic in dispatch_render() - Removed redundant calls from all effect subclasses - Updated effect.h comments to reflect automatic behavior - Updated EFFECT_WORKFLOW.md templates Benefits: - 16 lines removed from effect implementations - Consistent pattern enforced at compile time - Reduced boilerplate for new effects Tests: 34/34 passing handoff(Claude): Effect base class now handles uniforms automatically --- src/effects/gaussian_blur_effect.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/effects/gaussian_blur_effect.cc') diff --git a/src/effects/gaussian_blur_effect.cc b/src/effects/gaussian_blur_effect.cc index 0548b4a..a925dee 100644 --- a/src/effects/gaussian_blur_effect.cc +++ b/src/effects/gaussian_blur_effect.cc @@ -12,7 +12,6 @@ GaussianBlur::GaussianBlur(const GpuContext& ctx, : Effect(ctx, inputs, outputs, start_time, end_time), pipeline_(nullptr), bind_group_(nullptr) { HEADLESS_RETURN_IF_NULL(ctx_.device); - init_uniforms_buffer(); create_linear_sampler(); params_buffer_.init(ctx_.device); @@ -27,8 +26,7 @@ void GaussianBlur::render(WGPUCommandEncoder encoder, WGPUTextureView input_view = nodes.get_view(input_nodes_[0]); WGPUTextureView output_view = nodes.get_view(output_nodes_[0]); - // Update uniforms - uniforms_buffer_.update(ctx_.queue, params); + // Update effect-specific params params_buffer_.update(ctx_.queue, blur_params_); // Update bind group -- cgit v1.2.3