summaryrefslogtreecommitdiff
path: root/src/effects/passthrough_effect.h
AgeCommit message (Collapse)Author
12 hoursrefactor(gpu): Add RAII wrapper for WGPU resources to eliminate manual cleanupskal
Introduces WGPUResource template with automatic release on destruction. Reduces boilerplate in effect destructors and prevents resource leaks. - set() for one-time initialization - replace() for per-frame recreation - Field ordering documented for dependency management Converted 3 effects (Heptagon, Flash, Passthrough) and Effect base class. All tests pass (34/34). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
12 hoursrefactor(effects): Factor shared initialization into Effect base classskal
Eliminate ~100 lines of duplicated code across effect subclasses by moving common resource initialization to the base Effect class. Most effects repeatedly created uniforms buffers, samplers, and dummy textures with identical configurations. Changes: - Add shared members to Effect: uniforms_buffer_, sampler_, dummy_texture_* - Add helpers: init_uniforms_buffer(), create_*_sampler(), create_dummy_scene_texture() - Add gpu_create_*_sampler() and gpu_create_dummy_scene_texture() to gpu.h - Move HEADLESS_RETURN_IF_NULL to Effect constructor - Update 7 effects to use base class helpers (Flash, Heptagon, Passthrough, Placeholder, GaussianBlur, Particles, PeakMeter) Benefits: Improved consistency, easier maintenance, reduced binary size. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
16 hoursfeat: add time-based effect activation with auto-passthroughskal
Effects now accept start/end time parameters and automatically passthrough when inactive. Implements buffer chain integrity via compile-time validation. - Effect base class: dispatch_render() checks time bounds, auto-passthroughs 1:1 input/output effects outside [start, end] interval - seq_compiler.py: validates producer/consumer lifespan constraints for multi-output effects, adds --validate flag, always validates before codegen - Updated all 9 effect classes and test fixtures to pass start/end times - check_all.sh: includes timeline validation step - Tests: 34/34 passing, demo runs successfully Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
17 hoursstyle: Apply clang-formatskal
27 hoursrefactor: complete removal of 'Effect' suffix from C++ class namesskal
Update effect class definitions in headers and implementations to match timeline.seq naming convention. All tests passing (34/34). Classes renamed: - PassthroughEffect → Passthrough - GaussianBlurEffect → GaussianBlur - PlaceholderEffect → Placeholder - HeptagonEffect → Heptagon - ParticlesEffect → Particles - RotatingCubeEffect → RotatingCube - Hybrid3DEffect → Hybrid3D - FlashEffect → Flash - PeakMeterEffect → PeakMeter Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 hoursrefactor: remove v2 versioning artifacts, establish Sequence as canonical systemskal
Complete v1→v2 migration cleanup: rename 29 files (sequence_v2→sequence, effect_v2→effect, 14 effect files, 8 shaders, compiler, docs), update all class names and references across 54 files. Archive v1 timeline. System now uses standard naming with all versioning removed. 30/34 tests passing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
37 hoursfeat(sequence): complete v2 migration with DAG-based routingskal
Phase 4 complete: V1 system removed, v2 fully operational. Architecture Changes: - Explicit Node system with typed buffers (u8x4_norm, f32x4, depth24) - DAG effect routing with multi-input/multi-output support - Python compiler (seq_compiler_v2.py) with topological sort and ping-pong optimization - Compile-time node aliasing for framebuffer reuse V1 Removal (~4KB): - Deleted effect.h/cc base classes (1.4KB) - Deleted 19 v1 effect pairs: heptagon, particles, passthrough, gaussian_blur, solarize, scene1, chroma_aberration, vignette, hybrid_3d, flash_cube, theme_modulation, fade, flash, circle_mask, rotating_cube, sdf_test, distort, moving_ellipse, particle_spray (2.7KB) V2 Effects Ported: - PassthroughEffectV2, PlaceholderEffectV2 - GaussianBlurEffectV2 (multi-pass with temp nodes) - HeptagonEffectV2 (scene effect with dummy texture) - ParticlesEffectV2 (compute + render, format fixed) - RotatingCubeEffectV2 (3D with depth node) - Hybrid3DEffectV2 (Renderer3D integration, dummy textures for noise/sky) Compiler Features: - DAG validation (cycle detection, connectivity checks) - Topological sort for execution order - Ping-pong optimization (aliased node detection) - Surface-based and encoder-based RenderV2Timeline generation - init_effect_nodes() automatic generation Fixes Applied: - WebGPU binding layout validation (standard v2 post-process layout) - Surface format mismatch (ctx.format for blit, RGBA8Unorm for framebuffers) - Depth attachment compatibility (removed forced depth from gpu_create_render_pass) - Renderer3D texture initialization (created dummy 1x1 white textures) - ParticlesEffectV2 format (changed from ctx.format to RGBA8Unorm) - Encoder-based RenderV2Timeline (added missing preprocess() call) Testing: - 34/36 tests passing (2 v1-dependent tests disabled) - demo64k runs successfully (no crashes) - All seek positions work (--seek 12, --seek 15 validated) Documentation: - Updated PROJECT_CONTEXT.md (v2 status, reference to SEQUENCE_v2.md) - Added completion entry to COMPLETED.md TODO (Future): - Port CNN effects to v2 - Implement flatten mode (--flatten code generation) - Port remaining 10+ effects - Update HTML timeline editor for v2 (deferred) handoff(Claude): Sequence v2 migration complete, v1 removed, system operational. Phase 5 (editor) deferred per user preference. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
3 daysfeat(gpu): add SDF camera infrastructure and effect base classskal
Add unified camera system for SDF raymarching effects: - CameraParams struct (80 bytes): inv_view matrix + FOV/near/far/aspect - SDFEffect base class: manages camera uniform, provides update_camera() helpers - camera_common.wgsl: getCameraRay(), position/forward/up/right extractors - SDFTestEffect: working example with orbiting camera + animated sphere Refactor effect headers: - Extract class definitions from demo_effects.h to individual .h files - Update includes in .cc files to use specific headers - Cleaner compilation dependencies, faster incremental builds Documentation: - Add SDF_EFFECT_GUIDE.md with complete workflow - Update ARCHITECTURE.md, UNIFORM_BUFFER_GUIDELINES.md - Update EFFECT_WORKFLOW.md, CONTRIBUTING.md Tests: 34/34 passing, SDFTestEffect validated Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>