summaryrefslogtreecommitdiff
path: root/src/gpu/effects/distort_effect.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-09 11:39:54 +0100
committerskal <pascal.massimino@gmail.com>2026-02-09 11:39:54 +0100
commitd48aac685ecd47a80e0752011a1d78bc86094947 (patch)
tree8b36b3c4a212e05aeae91c560346a73f0e7987b6 /src/gpu/effects/distort_effect.cc
parentfd19130b3360d17b44247ec26533b20e051b7f8c (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/distort_effect.cc')
-rw-r--r--src/gpu/effects/distort_effect.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gpu/effects/distort_effect.cc b/src/gpu/effects/distort_effect.cc
index b5acf83..52a8ec7 100644
--- a/src/gpu/effects/distort_effect.cc
+++ b/src/gpu/effects/distort_effect.cc
@@ -9,9 +9,8 @@ DistortEffect::DistortEffect(const GpuContext& ctx)
: DistortEffect(ctx, DistortParams()) {
}
-DistortEffect::DistEffect(const GpuContext& ctx, const DistortParams& params)
+DistortEffect::DistortEffect(const GpuContext& ctx, const DistortParams& params)
: PostProcessEffect(ctx), params_(params) {
- common_uniforms_.init(ctx_.device);
params_buffer_.init(ctx_.device);
pipeline_ = create_post_process_pipeline(ctx_.device, ctx_.format,
distort_shader_wgsl);
@@ -27,7 +26,7 @@ void DistortEffect::render(WGPURenderPassEncoder pass, float t, float b,
.beat = b,
.audio_intensity = i,
};
- common_uniforms_.update(ctx_.queue, common_u);
+ uniforms_.update(ctx_.queue, common_u);
// Populate DistortParams
const DistortParams distort_p = {
@@ -40,7 +39,5 @@ void DistortEffect::render(WGPURenderPassEncoder pass, float t, float b,
}
void DistortEffect::update_bind_group(WGPUTextureView v) {
-
- pp_update_bind_group(ctx_.device, pipeline_, &bind_group_, v, common_uniforms_.get(), params_buffer_);
-
-}
+ pp_update_bind_group(ctx_.device, pipeline_, &bind_group_, v, uniforms_.get(), params_buffer_);
+} \ No newline at end of file