// CNN post-processing effect header // Multi-layer neural network stylization #pragma once #include "gpu/effect.h" #include "gpu/uniform_helper.h" struct CNNLayerParams { int layer_index; int use_residual; float _pad[2]; }; static_assert(sizeof(CNNLayerParams) == 16); class CNNEffect : public PostProcessEffect { public: explicit CNNEffect(const GpuContext& ctx, int num_layers = 1); void init(MainSequence* demo) override; void render(WGPURenderPassEncoder pass, float time, float beat, float intensity, float aspect_ratio) override; void update_bind_group(WGPUTextureView input_view) override; private: int num_layers_; WGPUTextureView input_view_; UniformBuffer params_buffer_; WGPUBindGroup bind_group_; };