diff options
Diffstat (limited to 'src/gpu/effects/distort_effect.cc')
| -rw-r--r-- | src/gpu/effects/distort_effect.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/gpu/effects/distort_effect.cc b/src/gpu/effects/distort_effect.cc index 52a8ec7..97622b2 100644 --- a/src/gpu/effects/distort_effect.cc +++ b/src/gpu/effects/distort_effect.cc @@ -16,17 +16,10 @@ DistortEffect::DistortEffect(const GpuContext& ctx, const DistortParams& params) distort_shader_wgsl); } -void DistortEffect::render(WGPURenderPassEncoder pass, float t, float b, - float i, float a) { +void DistortEffect::render(WGPURenderPassEncoder pass, + const CommonPostProcessUniforms& uniforms) { // Populate CommonPostProcessUniforms - const CommonPostProcessUniforms common_u = { - .resolution = {(float)width_, (float)height_}, - .aspect_ratio = a, - .time = t, - .beat = b, - .audio_intensity = i, - }; - uniforms_.update(ctx_.queue, common_u); + uniforms_.update(ctx_.queue, uniforms); // Populate DistortParams const DistortParams distort_p = { @@ -35,7 +28,7 @@ void DistortEffect::render(WGPURenderPassEncoder pass, float t, float b, }; params_buffer_.update(ctx_.queue, distort_p); - PostProcessEffect::render(pass, t, b, i, a); + PostProcessEffect::render(pass, uniforms); } void DistortEffect::update_bind_group(WGPUTextureView v) { |
