diff options
Diffstat (limited to 'src/gpu/effects/cnn_effect.cc')
| -rw-r--r-- | src/gpu/effects/cnn_effect.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/effects/cnn_effect.cc b/src/gpu/effects/cnn_effect.cc index b2305b2..83a3365 100644 --- a/src/gpu/effects/cnn_effect.cc +++ b/src/gpu/effects/cnn_effect.cc @@ -79,12 +79,19 @@ void CNNEffect::resize(int width, int height) { void CNNEffect::render(WGPURenderPassEncoder pass, const CommonPostProcessUniforms& uniforms) { - (void)uniforms; if (!bind_group_) { fprintf(stderr, "CNN render: no bind_group\n"); return; } + float effective_blend = blend_amount_; + if (beat_modulated_) { + effective_blend = blend_amount_ * uniforms.beat_phase * beat_scale_; + } + + CNNLayerParams params = {layer_index_, effective_blend, {0.0f, 0.0f}}; + params_buffer_.update(ctx_.queue, params); + wgpuRenderPassEncoderSetPipeline(pass, pipeline_); wgpuRenderPassEncoderSetBindGroup(pass, 0, bind_group_, 0, nullptr); wgpuRenderPassEncoderDraw(pass, 3, 1, 0, 0); |
