From d6cc50eb49275bbc0de21d4c65a5172d5d65f790 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 14 Feb 2026 14:55:58 +0100 Subject: refactor(gpu): Relocate effects to src/effects and streamline includes This refactoring improves the project's structure by decoupling visual effects from the core GPU module. All effect implementations have been moved from to a new top-level directory. Shared utilities like , , and have been consolidated into the parent directory. - **Motivation**: To create a clearer separation of concerns, making the codebase easier to navigate and maintain. This move treats effects as a distinct layer that depends on the core GPU module, rather than being embedded within it. - **Changes**: - Created new directory. - Moved all effect source files (, ) to . - Moved shared helpers (, , ) to . - Updated and to reflect the new file locations for all build targets. - Corrected all directives across the entire codebase (, , ) to point to the new paths. - Updated all markdown documentation ( files) to ensure file paths and architectural descriptions are accurate. - Fixed several compiler errors related to incorrect enum casting () that were exposed during cross-compilation for Windows. - **Verification**: - The entire project builds successfully for both native and Windows cross-compilation targets. - All 34 tests pass (Usage ctest [options]). - The --- Running Native Build & Tests --- Configuring with all options enabled (tests + tools)... -- -- Build Configuration: -- DEMO_SIZE_OPT: ON -- DEMO_STRIP_ALL: ON -- DEMO_FINAL_STRIP: OFF -- DEMO_STRIP_EXTERNAL_LIBS: OFF -- DEMO_BUILD_TESTS: ON -- DEMO_BUILD_TOOLS: ON -- DEMO_ENABLE_COVERAGE: OFF -- DEMO_ENABLE_DEBUG_LOGS: OFF -- DEMO_HEADLESS: OFF -- DEMO_WORKSPACE: main -- -- Loaded workspace: Main Demo -- Timeline: timeline.seq -- Music: pop_punk_drums.track -- Assets: assets.txt -- Using workspace: main -- Configuring done (0.0s) -- Generating done (0.1s) -- Build files have been written to: /Users/skal/demo/build Building all targets (demo, tests, and tools)... [ 0%] Built target validate_uniforms_script [ 1%] Built target procedural [ 2%] Validating uniform buffer sizes and alignments... [ 3%] Built target tracker_compiler [ 4%] Built target test_3d [ 4%] Built target test_maths [ 4%] Built target seq_compiler [ 4%] Built target tracker_compiler_host [ 5%] Built target asset_packer [ 5%] Built target test_procedural [ 6%] Compiling demo sequence from workspace main... [ 6%] Built target generate_tracker_music [ 6%] Built target generate_test_demo_music [ 6%] Compiling test_demo sequence... Using BPM: 90 Successfully generated timeline with 16 sequences. Using BPM: 120 Demo end time: 16.000000s Successfully generated timeline with 1 sequences. [ 6%] Built target generate_test_demo_timeline [ 6%] Built target generate_timeline Validation Warning for 'CommonPostProcessUniforms': Matching WGSL struct not found. Validation OK for 'FadeParams': Size 16 matches C++ expected size. Validation OK for 'ThemeModulationParams': Size 16 matches C++ expected size. Validation OK for 'GaussianBlurParams': Size 8 matches C++ expected size. Validation OK for 'DistortParams': Size 8 matches C++ expected size. Validation OK for 'CircleMaskParams': Size 16 matches C++ expected size. [ 6%] Built target generate_test_assets [ 7%] Built target generate_demo_assets [ 7%] Built target validate_uniforms [ 8%] Built target util [ 10%] Built target test_assets [ 11%] Built target test_shader_assets [ 12%] Built target test_file_watcher [ 15%] Built target 3d [ 21%] Built target test_platform [ 22%] Built target audio [ 23%] Built target test_window [ 26%] Built target test_fft [ 27%] Built target test_synth [ 27%] Built target test_spectral_brush [ 27%] Built target test_physics [ 28%] Built target test_dct [ 31%] Building CXX object CMakeFiles/gpu.dir/src/gpu/effect.cc.o [ 30%] Built target test_mock_backend [ 32%] Built target test_scene_loader [ 33%] Built target test_audio_backend [ 34%] Built target test_audio_gen [ 36%] Built target test_silent_backend [ 39%] Built target test_jittered_audio [ 39%] Building CXX object CMakeFiles/gpu.dir/src/effects/heptagon_effect.cc.o [ 42%] Built target test_wav_dump [ 44%] Built target test_tracker_timing [ 44%] Building CXX object CMakeFiles/gpu.dir/src/effects/particles_effect.cc.o [ 45%] Building CXX object CMakeFiles/gpu.dir/src/effects/passthrough_effect.cc.o [ 47%] Built target test_variable_tempo [ 50%] Built target test_audio_engine [ 52%] Built target test_tracker [ 52%] Building CXX object CMakeFiles/gpu.dir/src/effects/moving_ellipse_effect.cc.o [ 52%] Building CXX object CMakeFiles/gpu.dir/src/effects/particle_spray_effect.cc.o [ 52%] Building CXX object CMakeFiles/gpu.dir/src/effects/gaussian_blur_effect.cc.o [ 54%] Built target test_spectool [ 55%] Building CXX object CMakeFiles/gpu.dir/src/effects/solarize_effect.cc.o [ 55%] Building CXX object CMakeFiles/gpu.dir/src/effects/scene1_effect.cc.o [ 55%] Building CXX object CMakeFiles/gpu.dir/src/effects/chroma_aberration_effect.cc.o [ 55%] Building CXX object CMakeFiles/gpu.dir/src/gpu/shaders.cc.o [ 57%] Building CXX object CMakeFiles/gpu.dir/src/effects/vignette_effect.cc.o [ 57%] Building CXX object CMakeFiles/gpu.dir/src/gpu/post_process_helper.cc.o [ 57%] Linking CXX static library libgpu.a [ 60%] Built target gpu [ 60%] Linking CXX executable test_uniform_helper [ 60%] Linking CXX executable test_shader_composer [ 60%] Building CXX object CMakeFiles/test_sequence.dir/src/tests/assets/test_sequence.cc.o [ 61%] Linking CXX executable test_noise_functions [ 62%] Linking CXX executable test_shader_compilation [ 62%] Building CXX object CMakeFiles/test_demo.dir/src/app/test_demo.cc.o [ 62%] Building CXX object CMakeFiles/demo64k.dir/src/app/main.cc.o [ 62%] Building CXX object CMakeFiles/test_3d_render.dir/src/generated/timeline.cc.o [ 63%] Built target test_uniform_helper [ 64%] Built target test_shader_composer [ 64%] Building CXX object CMakeFiles/test_3d_physics.dir/src/generated/timeline.cc.o [ 65%] Built target test_noise_functions [ 66%] Built target test_shader_compilation [ 67%] Building CXX object CMakeFiles/test_mesh.dir/src/generated/timeline.cc.o [ 67%] Building CXX object CMakeFiles/test_effect_base.dir/src/tests/gpu/test_effect_base.cc.o [ 67%] Building CXX object CMakeFiles/test_demo_effects.dir/src/tests/gpu/test_demo_effects.cc.o [ 67%] Building CXX object CMakeFiles/test_sequence.dir/src/generated/timeline.cc.o [ 68%] Building CXX object CMakeFiles/test_demo.dir/src/generated/test_demo_timeline.cc.o [ 68%] Building CXX object CMakeFiles/demo64k.dir/src/generated/timeline.cc.o [ 68%] Linking CXX executable test_3d_render [ 68%] Building CXX object CMakeFiles/test_effect_base.dir/src/generated/timeline.cc.o [ 68%] Linking CXX executable test_3d_physics [ 68%] Linking CXX executable test_mesh [ 71%] Built target test_3d_render [ 71%] Building CXX object CMakeFiles/test_post_process_helper.dir/src/tests/gpu/test_post_process_helper.cc.o [ 72%] Building CXX object CMakeFiles/test_demo_effects.dir/src/generated/timeline.cc.o [ 72%] Linking CXX executable test_demo [ 75%] Built target test_3d_physics [ 77%] Built target test_mesh [ 77%] Linking CXX executable test_texture_manager [ 78%] Linking CXX executable test_sequence [ 78%] Linking CXX executable test_gpu_procedural [ 80%] Built target test_demo [ 81%] Linking CXX executable test_gpu_composite [ 81%] Linking CXX executable demo64k [ 83%] Built target test_sequence [ 85%] Built target test_texture_manager [ 86%] Built target test_gpu_procedural [ 86%] Linking CXX executable test_post_process_helper [ 86%] Linking CXX executable test_effect_base [ 87%] Built target test_gpu_composite [ 90%] Built target demo64k [ 92%] Built target test_post_process_helper [ 96%] Built target test_effect_base [ 96%] Linking CXX executable test_demo_effects [100%] Built target test_demo_effects Running test suite... Test project /Users/skal/demo/build Start 1: HammingWindowTest 1/34 Test #1: HammingWindowTest ................ Passed 0.00 sec Start 2: MathUtilsTest 2/34 Test #2: MathUtilsTest .................... Passed 0.00 sec Start 3: FileWatcherTest 3/34 Test #3: FileWatcherTest .................. Passed 0.00 sec Start 4: SynthEngineTest 4/34 Test #4: SynthEngineTest .................. Passed 0.00 sec Start 5: DctTest 5/34 Test #5: DctTest .......................... Passed 0.00 sec Start 6: FftTest 6/34 Test #6: FftTest .......................... Passed 0.01 sec Start 7: SpectralBrushTest 7/34 Test #7: SpectralBrushTest ................ Passed 0.01 sec Start 8: AudioGenTest 8/34 Test #8: AudioGenTest ..................... Passed 0.00 sec Start 9: AudioBackendTest 9/34 Test #9: AudioBackendTest ................. Passed 0.00 sec Start 10: SilentBackendTest 10/34 Test #10: SilentBackendTest ................ Passed 0.00 sec Start 11: MockAudioBackendTest 11/34 Test #11: MockAudioBackendTest ............. Passed 0.00 sec Start 12: WavDumpBackendTest 12/34 Test #12: WavDumpBackendTest ............... Passed 0.00 sec Start 13: JitteredAudioBackendTest 13/34 Test #13: JitteredAudioBackendTest ......... Passed 0.00 sec Start 14: TrackerTimingTest 14/34 Test #14: TrackerTimingTest ................ Passed 0.00 sec Start 15: VariableTempoTest 15/34 Test #15: VariableTempoTest ................ Passed 0.00 sec Start 16: TrackerSystemTest 16/34 Test #16: TrackerSystemTest ................ Passed 0.01 sec Start 17: AudioEngineTest 17/34 Test #17: AudioEngineTest .................. Passed 0.00 sec Start 18: ShaderAssetValidation 18/34 Test #18: ShaderAssetValidation ............ Passed 0.00 sec Start 19: ShaderCompilationTest 19/34 Test #19: ShaderCompilationTest ............ Passed 0.02 sec Start 20: NoiseFunctionsTest 20/34 Test #20: NoiseFunctionsTest ............... Passed 0.01 sec Start 21: UniformHelperTest 21/34 Test #21: UniformHelperTest ................ Passed 0.00 sec Start 22: AssetManagerTest 22/34 Test #22: AssetManagerTest ................. Passed 0.01 sec Start 23: SequenceSystemTest 23/34 Test #23: SequenceSystemTest ............... Passed 0.01 sec Start 24: ProceduralGenTest 24/34 Test #24: ProceduralGenTest ................ Passed 0.01 sec Start 25: PhysicsTest 25/34 Test #25: PhysicsTest ...................... Passed 0.01 sec Start 26: ThreeDSystemTest 26/34 Test #26: ThreeDSystemTest ................. Passed 0.00 sec Start 27: ShaderComposerTest 27/34 Test #27: ShaderComposerTest ............... Passed 0.01 sec Start 28: SceneLoaderTest 28/34 Test #28: SceneLoaderTest .................. Passed 0.01 sec Start 29: EffectBaseTest 29/34 Test #29: EffectBaseTest ................... Passed 0.04 sec Start 30: DemoEffectsTest 30/34 Test #30: DemoEffectsTest .................. Passed 0.03 sec Start 31: PostProcessHelperTest 31/34 Test #31: PostProcessHelperTest ............ Passed 0.02 sec Start 32: TextureManagerTest 32/34 Test #32: TextureManagerTest ............... Passed 0.02 sec Start 33: GpuProceduralTest 33/34 Test #33: GpuProceduralTest ................ Passed 0.18 sec Start 34: GpuCompositeTest 34/34 Test #34: GpuCompositeTest ................. Passed 0.20 sec 100% tests passed, 0 tests failed out of 34 Label Time Summary: 3d = 0.01 sec*proc (3 tests) assets = 0.02 sec*proc (2 tests) audio = 0.07 sec*proc (15 tests) gpu = 0.54 sec*proc (11 tests) util = 0.01 sec*proc (3 tests) Total Test time (real) = 0.67 sec Verifying tools compile... [ 9%] Built target procedural [ 18%] Built target tracker_compiler_host [ 18%] Built target tracker_compiler [ 18%] Built target generate_tracker_music [ 18%] Built target asset_packer [ 27%] Built target generate_demo_assets [ 27%] Built target generate_test_assets [ 36%] Built target util [ 81%] Built target audio [100%] Built target test_spectool --- Running Windows Cross-Compilation Build --- Building native tools... -- -- Build Configuration: -- DEMO_SIZE_OPT: OFF -- DEMO_STRIP_ALL: OFF -- DEMO_FINAL_STRIP: OFF -- DEMO_STRIP_EXTERNAL_LIBS: OFF -- DEMO_BUILD_TESTS: OFF -- DEMO_BUILD_TOOLS: OFF -- DEMO_ENABLE_COVERAGE: OFF -- DEMO_ENABLE_DEBUG_LOGS: OFF -- DEMO_HEADLESS: OFF -- DEMO_WORKSPACE: main -- -- Loaded workspace: Main Demo -- Timeline: timeline.seq -- Music: pop_punk_drums.track -- Assets: assets.txt -- Using workspace: main -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /Users/skal/demo/build_native [ 50%] Built target procedural [100%] Built target asset_packer [100%] Built target seq_compiler [100%] Built target tracker_compiler_host Cross-compiling for Windows... -- -- Build Configuration: -- DEMO_SIZE_OPT: ON -- DEMO_STRIP_ALL: ON -- DEMO_FINAL_STRIP: OFF -- DEMO_STRIP_EXTERNAL_LIBS: OFF -- DEMO_BUILD_TESTS: OFF -- DEMO_BUILD_TOOLS: OFF -- DEMO_ENABLE_COVERAGE: OFF -- DEMO_ENABLE_DEBUG_LOGS: OFF -- DEMO_HEADLESS: OFF -- DEMO_WORKSPACE: main -- -- Loaded workspace: Main Demo -- Timeline: timeline.seq -- Music: pop_punk_drums.track -- Assets: assets.txt -- Using workspace: main -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /Users/skal/demo/build_win [ 2%] Built target validate_uniforms_script [ 2%] Built target generate_timeline [ 4%] Built target generate_test_demo_timeline [ 4%] Built target generate_demo_assets [ 4%] Built target generate_test_assets [ 6%] Built target procedural [ 9%] Built target tracker_compiler_host [ 10%] Validating uniform buffer sizes and alignments... [ 11%] Built target generate_tracker_music [ 13%] Built target generate_test_demo_music [ 16%] Built target util [ 28%] Built target 3d [ 45%] Built target audio [ 49%] Building CXX object CMakeFiles/gpu.dir/src/effects/heptagon_effect.cc.obj [ 52%] Building CXX object CMakeFiles/gpu.dir/src/effects/gaussian_blur_effect.cc.obj [ 54%] Building CXX object CMakeFiles/gpu.dir/src/effects/particles_effect.cc.obj [ 54%] Building CXX object CMakeFiles/gpu.dir/src/effects/moving_ellipse_effect.cc.obj [ 54%] Building CXX object CMakeFiles/gpu.dir/src/gpu/effect.cc.obj [ 54%] Building CXX object CMakeFiles/gpu.dir/src/effects/passthrough_effect.cc.obj [ 54%] Building CXX object CMakeFiles/gpu.dir/src/effects/particle_spray_effect.cc.obj Validation Warning for 'CommonPostProcessUniforms': Matching WGSL struct not found. Validation OK for 'FadeParams': Size 16 matches C++ expected size. Validation OK for 'ThemeModulationParams': Size 16 matches C++ expected size. Validation OK for 'GaussianBlurParams': Size 8 matches C++ expected size. Validation OK for 'DistortParams': Size 8 matches C++ expected size. Validation OK for 'CircleMaskParams': Size 16 matches C++ expected size. [ 54%] Built target validate_uniforms [ 55%] Building CXX object CMakeFiles/gpu.dir/src/effects/solarize_effect.cc.obj [ 57%] Building CXX object CMakeFiles/gpu.dir/src/effects/scene1_effect.cc.obj [ 57%] Building CXX object CMakeFiles/gpu.dir/src/effects/chroma_aberration_effect.cc.obj [ 58%] Building CXX object CMakeFiles/gpu.dir/src/effects/vignette_effect.cc.obj [ 59%] Building CXX object CMakeFiles/gpu.dir/src/gpu/post_process_helper.cc.obj [ 60%] Building CXX object CMakeFiles/gpu.dir/src/gpu/shaders.cc.obj [ 62%] Linking CXX static library libgpu.a [ 77%] Built target gpu [ 79%] Building CXX object CMakeFiles/demo64k.dir/src/app/main.cc.obj [ 79%] Building CXX object CMakeFiles/test_demo.dir/src/app/test_demo.cc.obj [ 80%] Building CXX object CMakeFiles/demo64k.dir/src/generated/timeline.cc.obj [ 81%] Building CXX object CMakeFiles/test_demo.dir/src/generated/test_demo_timeline.cc.obj [ 82%] Linking CXX executable test_demo.exe [ 90%] Built target test_demo [ 91%] Linking CXX executable demo64k.exe [100%] Built target demo64k Copying MinGW DLLs... Crunching build_win/demo64k.exe... Ultimate Packer for eXecutables Copyright (C) 1996 - 2026 UPX 5.1.0 Markus Oberhumer, Laszlo Molnar & John Reiser Jan 7th 2026 File size Ratio Format Name -------------------- ------ ----------- ----------- 7036416 -> 4680704 66.52% win64/pe demo64k_packed.exe Packed 1 file. ------------------------------------------------ Size Report: -rwxr-xr-x 1 skal 89939 6.7M Feb 14 14:55 build_win/demo64k.exe -rwxr-xr-x 1 skal 89939 6.7M Feb 14 14:55 build_win/demo64k_stripped.exe -rwxr-xr-x 1 skal 89939 4.5M Feb 14 14:55 build_win/demo64k_packed.exe ------------------------------------------------ Top 20 Largest Symbols (from unstripped): ------------------------------------------------ Build complete. Output: build_win/demo64k.exe All checks passed successfully. script completes without errors. This change streamlines the project's architecture without altering any functionality. --- doc/CNN_DEBUG.md | 4 ++-- doc/CNN_EFFECT.md | 4 ++-- doc/CNN_FLATTEN_ANALYSIS.md | 2 +- doc/CNN_V2.md | 12 ++++++------ doc/CNN_V2_BINARY_FORMAT.md | 2 +- doc/EFFECT_WORKFLOW.md | 22 +++++++++++----------- doc/RECIPE.md | 6 +++--- doc/WORKSPACE_SYSTEM.md | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) (limited to 'doc') diff --git a/doc/CNN_DEBUG.md b/doc/CNN_DEBUG.md index dba0b60..ba220a0 100644 --- a/doc/CNN_DEBUG.md +++ b/doc/CNN_DEBUG.md @@ -11,7 +11,7 @@ CNN post-processing effect showed black screen when activated at 11.50s, despite **Fix**: Moved capture before loop starts (lines 308-346). Capture now copies `framebuffer_a` to `captured_frame` auxiliary texture ONCE before any post-effects run. ### Bug 2: Missing Uniforms Update ⚠️ CRITICAL -**Location**: `src/gpu/effects/cnn_effect.cc` +**Location**: `src/effects/cnn_effect.cc` **Issue**: `CNNEffect::update_bind_group()` never updated `uniforms_` buffer. `uniforms.resolution` uninitialized (0,0 or garbage) → UV calculation `p.xy / uniforms.resolution` produced NaN → all texture samples black. **Fix**: Added uniforms update before bind group creation (lines 132-142): ```cpp @@ -34,7 +34,7 @@ uniforms_.update(ctx_.queue, u); ## Files Modified - `src/gpu/effect.cc`: Lines 308-346 (capture timing) -- `src/gpu/effects/cnn_effect.cc`: Lines 132-142 (uniforms update) +- `src/effects/cnn_effect.cc`: Lines 132-142 (uniforms update) ## Verification Test: `demo64k --seek 11.5` diff --git a/doc/CNN_EFFECT.md b/doc/CNN_EFFECT.md index c14130a..40f095e 100644 --- a/doc/CNN_EFFECT.md +++ b/doc/CNN_EFFECT.md @@ -80,7 +80,7 @@ CNNEffect supports multi-layer networks via automatic effect chaining: ### File Structure ``` -src/gpu/effects/ +src/effects/ cnn_effect.h/cc # CNNEffect class + framebuffer capture workspaces/main/shaders/cnn/ @@ -156,7 +156,7 @@ cmake --build build -j4 && ./build/demo64k **Single layer (manual):** ```cpp -#include "gpu/effects/cnn_effect.h" +#include "effects/cnn_effect.h" CNNEffectParams p; p.layer_index = 0; diff --git a/doc/CNN_FLATTEN_ANALYSIS.md b/doc/CNN_FLATTEN_ANALYSIS.md index 88f3db6..bf63c5d 100644 --- a/doc/CNN_FLATTEN_ANALYSIS.md +++ b/doc/CNN_FLATTEN_ANALYSIS.md @@ -185,5 +185,5 @@ These yield better size/performance than shader architecture changes. - `doc/CNN_EFFECT.md` - CNN implementation details - `doc/CNN.md` - High-level CNN design -- `src/gpu/effects/cnn_effect.cc` - Current implementation +- `src/effects/cnn_effect.cc` - Current implementation - `workspaces/main/shaders/cnn_*.wgsl` - Shader snippets diff --git a/doc/CNN_V2.md b/doc/CNN_V2.md index 2d1d4c4..b7fd6f8 100644 --- a/doc/CNN_V2.md +++ b/doc/CNN_V2.md @@ -520,13 +520,13 @@ See `doc/CNN_V2_WEB_TOOL.md` for detailed documentation ### Phase 2: C++ Effect Class -- [ ] `src/gpu/effects/cnn_v2_effect.h` - Header +- [ ] `src/effects/cnn_v2_effect.h` - Header - [ ] Class declaration inheriting from `PostProcessEffect` - [ ] Static features texture member - [ ] Layer textures vector - [ ] Pipeline and bind group members -- [ ] `src/gpu/effects/cnn_v2_effect.cc` - Implementation +- [ ] `src/effects/cnn_v2_effect.cc` - Implementation - [ ] Constructor: Load shaders, create textures - [ ] `init()`: Create pipelines, bind groups - [ ] `render()`: Multi-pass execution @@ -598,8 +598,8 @@ workspaces/main/shaders/cnn_v2/cnn_v2_layer_1.wgsl # Inner layer (generated workspaces/main/shaders/cnn_v2/cnn_v2_layer_2.wgsl # Output layer (generated) # C++ implementation -src/gpu/effects/cnn_v2_effect.h # Effect class header -src/gpu/effects/cnn_v2_effect.cc # Effect implementation +src/effects/cnn_v2_effect.h # Effect class header +src/effects/cnn_v2_effect.cc # Effect implementation # Python training/export training/train_cnn_v2.py # Training script @@ -630,7 +630,7 @@ TODO.md # Add CNN v2 task ``` training/train_cnn.py # Original training -src/gpu/effects/cnn_effect.* # Original effect +src/effects/cnn_effect.* # Original effect workspaces/main/shaders/cnn_*.wgsl # Original v1 shaders ``` @@ -750,7 +750,7 @@ See `doc/CNN_V2_BINARY_FORMAT.md` for proposed descriptor format. ## References -- **v1 Implementation:** `src/gpu/effects/cnn_effect.*` +- **v1 Implementation:** `src/effects/cnn_effect.*` - **Training Guide:** `doc/HOWTO.md` (CNN Training section) - **Test Tool:** `doc/CNN_TEST_TOOL.md` - **Shader System:** `doc/SEQUENCE.md` diff --git a/doc/CNN_V2_BINARY_FORMAT.md b/doc/CNN_V2_BINARY_FORMAT.md index f718960..59c859d 100644 --- a/doc/CNN_V2_BINARY_FORMAT.md +++ b/doc/CNN_V2_BINARY_FORMAT.md @@ -230,6 +230,6 @@ Benefits: ## Related Files - `training/export_cnn_v2_weights.py` - Binary export tool -- `src/gpu/effects/cnn_v2_effect.cc` - C++ loader +- `src/effects/cnn_v2_effect.cc` - C++ loader - `tools/cnn_v2_test/index.html` - WebGPU validator - `doc/CNN_V2.md` - Architecture design diff --git a/doc/EFFECT_WORKFLOW.md b/doc/EFFECT_WORKFLOW.md index e453b63..22b8dc9 100644 --- a/doc/EFFECT_WORKFLOW.md +++ b/doc/EFFECT_WORKFLOW.md @@ -19,8 +19,8 @@ Automated checklist for adding new visual effects to the demo. ### 1. Create Effect Files **Location:** -- Header: `src/gpu/effects/_effect.h` -- Implementation: `src/gpu/effects/_effect.cc` +- Header: `src/effects/_effect.h` +- Implementation: `src/effects/_effect.cc` - Shader: `workspaces/main/shaders/.wgsl` **Naming Convention:** @@ -69,7 +69,7 @@ SHADER_TUNNEL, NONE, shaders/tunnel.wgsl, "Tunnel effect shader" **File:** `CMakeLists.txt` -**Action:** Add `src/gpu/effects/_effect.cc` to **BOTH** GPU_SOURCES sections: +**Action:** Add `src/effects/_effect.cc` to **BOTH** GPU_SOURCES sections: - Headless mode section (around line 141-167) - Normal mode section (around line 171-197) @@ -78,14 +78,14 @@ SHADER_TUNNEL, NONE, shaders/tunnel.wgsl, "Tunnel effect shader" **Example:** ```cmake # In headless section (line ~152): - src/gpu/effects/solarize_effect.cc - src/gpu/effects/tunnel_effect.cc # <-- Add here - src/gpu/effects/chroma_aberration_effect.cc + src/effects/solarize_effect.cc + src/effects/tunnel_effect.cc # <-- Add here + src/effects/chroma_aberration_effect.cc # In normal section (line ~183): - src/gpu/effects/solarize_effect.cc - src/gpu/effects/tunnel_effect.cc # <-- Add here - src/gpu/effects/chroma_aberration_effect.cc + src/effects/solarize_effect.cc + src/effects/tunnel_effect.cc # <-- Add here + src/effects/chroma_aberration_effect.cc ``` ### 4. Include in demo_effects.h @@ -94,7 +94,7 @@ SHADER_TUNNEL, NONE, shaders/tunnel.wgsl, "Tunnel effect shader" **Action:** Add include directive: ```cpp -#include "gpu/effects/_effect.h" +#include "effects/_effect.h" ``` **Location:** Alphabetically with other effect includes @@ -241,4 +241,4 @@ cmake --build build -j4 - `tools/shadertoy/README.md` - ShaderToy conversion guide - `doc/SEQUENCE.md` - Timeline format documentation - `doc/CONTRIBUTING.md` - General contribution guidelines -- `src/gpu/effects/` - Existing effect examples +- `src/effects/` - Existing effect examples diff --git a/doc/RECIPE.md b/doc/RECIPE.md index d563027..f17afde 100644 --- a/doc/RECIPE.md +++ b/doc/RECIPE.md @@ -8,7 +8,7 @@ Use `ShaderComposer` to dynamically assemble shaders from snippets. **Pattern:** ```cpp -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include "generated/assets.h" // 1. Load base shader template from asset @@ -70,7 +70,7 @@ fn compute_color(uv: vec2) -> vec4 { )"); ``` -**Example usage:** `src/gpu/effects/rotating_cube_effect.cc:72-75` +**Example usage:** `src/effects/rotating_cube_effect.cc:72-75` ## QuadEffect with Auxiliary Textures @@ -161,7 +161,7 @@ EFFECT + MyEffect 0.0 10.0 strength=0.5 speed=3.0 EFFECT = MyEffect 10.0 20.0 strength=2.0 # speed keeps previous value ``` -**Example:** `src/gpu/effects/flash_effect.cc`, `src/gpu/effects/chroma_aberration_effect.cc` +**Example:** `src/effects/flash_effect.cc`, `src/effects/chroma_aberration_effect.cc` ## Uniform Buffer Alignment diff --git a/doc/WORKSPACE_SYSTEM.md b/doc/WORKSPACE_SYSTEM.md index 9362da6..64ba120 100644 --- a/doc/WORKSPACE_SYSTEM.md +++ b/doc/WORKSPACE_SYSTEM.md @@ -557,7 +557,7 @@ endif() **Modified files:** - `CMakeLists.txt` - Workspace support - `tools/asset_packer.cc` - Multi-path resolution -- `src/gpu/effects/shader_composer.cc` - Multi-path includes +- `src/gpu/shader_composer.cc` - Multi-path includes - `README.md` - Workspace documentation - `doc/HOWTO.md` - Build commands - `doc/CONTRIBUTING.md` - Workspace guidelines -- cgit v1.2.3