summaryrefslogtreecommitdiff
path: root/src/tests/test_demo_effects.cc
AgeCommit message (Collapse)Author
13 hoursfeat(gpu): Add auxiliary texture masking systemskal
Implements MainSequence auxiliary texture registry to support inter-effect texture sharing within a single frame. Primary use case: screen-space partitioning where multiple effects render to complementary regions. Architecture: - MainSequence::register_auxiliary_texture(name, width, height) Creates named texture that persists for entire frame - MainSequence::get_auxiliary_view(name) Retrieves texture view for reading/writing Use case example: - Effect1: Generate mask (1 = Effect1 region, 0 = Effect2 region) - Effect1: Render scene A where mask = 1 - Effect2: Reuse mask, render scene B where mask = 0 - Result: Both scenes composited to same framebuffer Implementation details: - Added std::map<std::string, AuxiliaryTexture> to MainSequence - Texture lifecycle managed by MainSequence (create/resize/shutdown) - Memory impact: ~4-8 MB per mask (acceptable for 2-3 masks) - Size impact: ~100 lines (~500 bytes code) Changes: - src/gpu/effect.h: Added auxiliary texture registry API - src/gpu/effect.cc: Implemented registry with FATAL_CHECK validation - doc/MASKING_SYSTEM.md: Complete architecture documentation - doc/HOWTO.md: Added auxiliary texture usage example Also fixed: - test_demo_effects.cc: Corrected EXPECTED_POST_PROCESS_COUNT (9→8) Pre-existing bug: DistortEffect was counted but not tested Testing: - All 33 tests pass (100%) - No functional changes to existing effects - Zero regressions See doc/MASKING_SYSTEM.md for detailed design rationale and examples.
14 hoursfix tree, remove Distort effectskal
15 hoursfeat(gpu): Add VignetteEffect and related filesskal
- Implemented VignetteEffect, including its shader, parameters, and sequence integration. - Added VignetteEffect to demo_effects.h, shaders.cc/h, and asset definitions. - Updated seq_compiler to handle VignetteEffect parameters. - Added VignetteEffect to test suite and updated expected counts. - Ensured all changes build and tests pass. - Added vignette_effect.cc implementation file. - Updated CMakeLists.txt to include the new effect file. - Updated assets/demo.seq to include the VignetteEffect. - Updated assets/final/demo_assets.txt with the new shader asset.
27 hoursfix(tests): Enable tests with DEMO_ALL_OPTIONS and fix tracker testskal
- Removed STRIP_ALL guards from test-only helpers and fixtures to allow compilation when DEMO_STRIP_ALL is enabled. - Updated test_tracker to use test_demo_music data for stability. - Relaxed test_tracker assertions to be robust against sample duration variations. - Re-applied clang-format to generated files.
27 hoursstyle: Apply clang-format to all source filesskal
42 hoursrefactor: Bundle GPU context into GpuContext structskal
- Created GpuContext struct {device, queue, format} - Updated Effect/PostProcessEffect to take const GpuContext& - Updated all 19 effect implementations - Updated MainSequence.init() and LoadTimeline() signatures - Updated generated timeline files - Updated all test files - Added gpu_get_context() accessor and fixture.ctx() helper Fixes test_mesh.cc compilation error from g_device/g_queue/g_format conflicts. All targets build successfully.
2 daystest(gpu): Add automatic validation for effect test coverageskal
Problem: When new effects are added to demo_effects.h, developers might forget to update test_demo_effects.cc, leading to untested code. Solution: Added compile-time constants and runtime assertions to enforce test coverage: 1. Added EXPECTED_POST_PROCESS_COUNT = 8 2. Added EXPECTED_SCENE_COUNT = 6 3. Runtime validation in each test function 4. Fails with clear error message if counts don't match Error message when validation fails: ✗ COVERAGE ERROR: Expected N effects, but only tested M! ✗ Did you add a new effect without updating the test? ✗ Update EXPECTED_*_COUNT in test_demo_effects.cc Updated CONTRIBUTING.md with mandatory test update requirement: - Added step 3 to "Adding a New Visual Effect" workflow - Clear instructions on updating effect counts - Verification command examples This ensures no effect can be added without corresponding test coverage. Tested validation by intentionally breaking count - error caught correctly.
2 daystest(gpu): Add comprehensive effect class testing (Phase 2.1)skal
Created test_demo_effects.cc to validate all effect classes: - Tests 8 post-process effects (FlashEffect, PassthroughEffect, GaussianBlurEffect, ChromaAberrationEffect, DistortEffect, SolarizeEffect, FadeEffect, ThemeModulationEffect) - Tests 6 scene effects (HeptagonEffect, ParticlesEffect, ParticleSprayEffect, MovingEllipseEffect, FlashCubeEffect, Hybrid3DEffect) - Gracefully skips effects requiring full Renderer3D pipeline (FlashCubeEffect, Hybrid3DEffect) with warning messages - Validates effect type classification (is_post_process()) Test approach: Smoke tests for construction and initialization - Construct effect → Add to Sequence → Sequence::init() - Verify is_initialized flag transitions from false → true - No crashes during initialization Added CMake target with proper dependencies: - Links against gpu, 3d, audio, procedural, util libraries - Depends on generate_timeline and generate_demo_assets Coverage: Adds validation for all 14 production effect classes Zero binary size impact: All test code under #if !defined(STRIP_ALL) Part of GPU Effects Test Infrastructure (Phase 2/3) Next: test_post_process_helper.cc (Phase 2.2)