summaryrefslogtreecommitdiff
path: root/src/app/test_demo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/test_demo.cc')
-rw-r--r--src/app/test_demo.cc89
1 files changed, 0 insertions, 89 deletions
diff --git a/src/app/test_demo.cc b/src/app/test_demo.cc
index 83e6f8b..6031aef 100644
--- a/src/app/test_demo.cc
+++ b/src/app/test_demo.cc
@@ -19,89 +19,6 @@
#include "generated/test_timeline.h"
extern float GetDemoDuration();
-// TODO: Port PeakMeterEffect and CNN effects to v2
-// #include "../../cnn_v1/src/cnn_v1_effect.h"
-// #include "../../cnn_v2/src/cnn_v2_effect.h"
-// #include "gpu/post_process_helper.h"
-// #include "gpu/shader_composer.h"
-
-#if 0 // Disabled: needs v2 port
-class PeakMeterEffect : public PostProcessEffectV2 {
- public:
- PeakMeterEffect(const GpuContext& ctx) : PostProcessEffect(ctx) {
- // Use ShaderComposer to include CommonUniforms from common_uniforms.wgsl
- const char* shader_main = R"(
- struct VertexOutput {
- @builtin(position) position: vec4<f32>,
- @location(0) uv: vec2<f32>,
- };
-
- struct EffectParams {
- unused: f32,
- };
-
- @group(0) @binding(0) var inputSampler: sampler;
- @group(0) @binding(1) var inputTexture: texture_2d<f32>;
- @group(0) @binding(2) var<uniform> uniforms: CommonUniforms;
- @group(0) @binding(3) var<uniform> params: EffectParams;
-
- @vertex
- fn vs_main(@builtin(vertex_index) vertexIndex: u32) -> VertexOutput {
- var output: VertexOutput;
- // Full-screen triangle (required for post-process pass-through)
- var pos = array<vec2<f32>, 3>(
- vec2<f32>(-1.0, -1.0),
- vec2<f32>(3.0, -1.0),
- vec2<f32>(-1.0, 3.0)
- );
- output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
- output.uv = pos[vertexIndex] * 0.5 + 0.5;
- return output;
- }
-
- @fragment
- fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
- // Bar dimensions
- let bar_y_min = 0.005;
- let bar_y_max = 0.015;
- let bar_x_min = 0.015;
- let bar_x_max = 0.250;
- let in_bar_y = input.uv.y >= bar_y_min && input.uv.y <= bar_y_max;
- let in_bar_x = input.uv.x >= bar_x_min && input.uv.x <= bar_x_max;
-
- // Optimization: Return bar color early (avoids texture sampling for ~5% of pixels)
- if (in_bar_y && in_bar_x) {
- let uv_x = (input.uv.x - bar_x_min) / (bar_x_max - bar_x_min);
- let factor = step(uv_x, uniforms.audio_intensity);
- return mix(vec4<f32>(0.0, 0.0, 0.0, 1.0), vec4<f32>(1.0, 0.0, 0.0,1.0), factor);
- }
-
- // Pass through input texture for rest of screen
- return textureSample(inputTexture, inputSampler, input.uv);
- }
- )";
-
- // Compose shader with common_uniforms to get CommonUniforms definition
- std::string shader_code =
- ShaderComposer::Get().Compose({"common_uniforms"}, shader_main);
-
- pipeline_ = create_post_process_pipeline(ctx_.device, ctx_.format,
- shader_code.c_str());
- }
-
- void update_bind_group(WGPUTextureView input_view) override {
- pp_update_bind_group(ctx_.device, pipeline_, &bind_group_, input_view,
- uniforms_.get(), {});
- }
-
- void render(WGPURenderPassEncoder pass,
- const UniformsSequenceParams& uniforms) override {
- uniforms_.update(ctx_.queue, uniforms);
- PostProcessEffect::render(pass, uniforms);
- }
-};
-#endif // Disabled: needs v2 port
-
static int g_cnn_version = 2; // Default to v2
#if !defined(STRIP_ALL)
@@ -228,12 +145,6 @@ int main(int argc, char** argv) {
// Initialize v2 timeline from test_demo.seq
InitializeSequences(*gpu_get_context(), width, height);
-#if !defined(STRIP_ALL)
- // TODO: Port CNN and peak meter effects to v2
- // const GpuContext* gpu_ctx = gpu_get_context();
- // (v1 gpu_add_custom_effect not available in v2)
-#endif
-
audio_init();
static AudioEngine g_audio_engine;