diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-09 11:39:54 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-09 11:39:54 +0100 |
| commit | d48aac685ecd47a80e0752011a1d78bc86094947 (patch) | |
| tree | 8b36b3c4a212e05aeae91c560346a73f0e7987b6 /src/gpu/effects/fade_effect.cc | |
| parent | fd19130b3360d17b44247ec26533b20e051b7f8c (diff) | |
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.
Diffstat (limited to 'src/gpu/effects/fade_effect.cc')
| -rw-r--r-- | src/gpu/effects/fade_effect.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gpu/effects/fade_effect.cc b/src/gpu/effects/fade_effect.cc index 7730a2e..39b54e0 100644 --- a/src/gpu/effects/fade_effect.cc +++ b/src/gpu/effects/fade_effect.cc @@ -63,14 +63,13 @@ FadeEffect::FadeEffect(const GpuContext& ctx) : PostProcessEffect(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 FadeEffect::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 FadeEffect::render(WGPURenderPassEncoder pass, float time, float beat, @@ -82,7 +81,7 @@ void FadeEffect::render(WGPURenderPassEncoder pass, float time, float beat, .beat = beat, .audio_intensity = intensity, }; - common_uniforms_.update(ctx_.queue, u); + uniforms_.update(ctx_.queue, u); // Example fade pattern: fade in at start, fade out at end // Customize this based on your needs |
