summaryrefslogtreecommitdiff
path: root/src/effects/placeholder_effect.cc
AgeCommit message (Collapse)Author
50 min.refactor(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>
2 hoursfix(build): Resolve Windows cross-compilation failuresskal
This commit fixes several issues that caused the Windows cross-compilation build (`scripts/build_win.sh`) to fail. The root causes were platform-specific API differences in the wgpu-native library and incorrect dependency tracking in the CMake build system for generated code. Changes: - **`tools/seq_compiler.py`**: The timeline generator now wraps `depthSlice` assignments in `#if !defined(DEMO_CROSS_COMPILE_WIN32)` directives to handle API differences in `WGPURenderPassColorAttachment`. - **`src/gpu/gpu.h`**: The `gpu_init_color_attachment` helper is now platform-aware, using a preprocessor guard for the `depthSlice` member. - **`src/effects/*.cc`**: All effects are updated to use the new platform-aware helper or have explicit guards for `depthSlice`. Also, replaced `WGPUTexelCopyTextureInfo` with the cross-platform alias `GpuTextureCopyInfo` in `rotating_cube_effect.cc`. - **`cmake`**: Added `tools/seq_compiler.py` as an explicit dependency to the `generate_timeline` and `generate_test_demo_timeline` custom commands. This ensures that changes to the generator script correctly trigger a rebuild of the generated C++ files. - **`scripts/build_win.sh`**: Removed the erroneous attempt to build the `seq_compiler.py` script as a native executable. With these changes, the Windows cross-compilation build now completes successfully.
5 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>
5 hoursstyle: Apply clang-formatskal
5 hoursrefactor: move shaders.{h,cc} to src/effects and remove v2 suffixskal
- Removed unused v1 shader declarations (13 variables) - Removed _v2 suffix from active shader names - Moved shaders.{h,cc} from src/gpu to src/effects - Updated all includes and build references - All tests pass (34/34) handoff(Claude): Cleaned up shader management, tests passing
16 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>
21 hoursrefactor(gpu): remove depthSlice conditionals, use platform.h abstractionskal
WGPU_DEPTH_SLICE_UNDEFINED is defined unconditionally via platform.h (native headers or Win32 macro). Remove redundant conditional compilation from 7 effects and gpu.h helper. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
22 hoursrefactor(headless): convert nullptr checks to strippable macrosskal
Added HEADLESS_RETURN_IF_NULL/HEADLESS_RETURN_VAL_IF_NULL macros that compile to no-ops in STRIP_ALL/FINAL_STRIP modes. Files updated: - fatal_error.h: New headless check macros - sequence.cc: NodeRegistry::create_texture - post_process_helper.cc: Pipeline creation functions - sampler_cache.h: SamplerCache::get_or_create - bind_group_builder.h: Layout/group builders - pipeline_builder.h: Shader and pipeline builders - All effect constructors (7 files) Headless tests passing. STRIP_ALL builds will have zero overhead. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
22 hoursfix(headless): add nullptr checks for GPU resource creationskal
- NodeRegistry::create_texture: skip texture creation when device is nullptr - Post-process helpers: skip pipeline/bind group creation in headless mode - SamplerCache: return nullptr for headless mode - BindGroupLayoutBuilder/BindGroupBuilder: skip creation with null device - RenderPipelineBuilder: skip shader module and pipeline creation in headless - PlaceholderEffect: skip sampler creation in headless mode - RotatingCubeEffect: early return in constructor for headless mode WIP: Some effects (GaussianBlur, etc.) still need headless checks Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
23 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>