diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-14 14:55:58 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-14 14:55:58 +0100 |
| commit | d6cc50eb49275bbc0de21d4c65a5172d5d65f790 (patch) | |
| tree | 642ffcb971bc58fd12ffa17bed5daeb00e4df8d0 | |
| parent | 7bb0b688de0d909828a58613c69dea85fa476400 (diff) | |
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.
| -rw-r--r-- | cmake/DemoSourceLists.cmake | 4 | ||||
| -rw-r--r-- | cmake/Validation.cmake | 18 | ||||
| -rw-r--r-- | doc/CNN_DEBUG.md | 4 | ||||
| -rw-r--r-- | doc/CNN_EFFECT.md | 4 | ||||
| -rw-r--r-- | doc/CNN_FLATTEN_ANALYSIS.md | 2 | ||||
| -rw-r--r-- | doc/CNN_V2.md | 12 | ||||
| -rw-r--r-- | doc/CNN_V2_BINARY_FORMAT.md | 2 | ||||
| -rw-r--r-- | doc/EFFECT_WORKFLOW.md | 22 | ||||
| -rw-r--r-- | doc/RECIPE.md | 6 | ||||
| -rw-r--r-- | doc/WORKSPACE_SYSTEM.md | 2 | ||||
| -rw-r--r-- | src/3d/renderer.cc | 2 | ||||
| -rw-r--r-- | src/3d/renderer_pipelines.cc | 2 | ||||
| -rw-r--r-- | src/app/test_demo.cc | 8 | ||||
| -rw-r--r-- | src/effects/chroma_aberration_effect.cc (renamed from src/gpu/effects/chroma_aberration_effect.cc) | 2 | ||||
| -rw-r--r-- | src/effects/circle_mask_effect.cc (renamed from src/gpu/effects/circle_mask_effect.cc) | 4 | ||||
| -rw-r--r-- | src/effects/circle_mask_effect.h (renamed from src/gpu/effects/circle_mask_effect.h) | 2 | ||||
| -rw-r--r-- | src/effects/cnn_effect.cc (renamed from src/gpu/effects/cnn_effect.cc) | 8 | ||||
| -rw-r--r-- | src/effects/cnn_effect.h (renamed from src/gpu/effects/cnn_effect.h) | 0 | ||||
| -rw-r--r-- | src/effects/cnn_v2_effect.cc (renamed from src/gpu/effects/cnn_v2_effect.cc) | 4 | ||||
| -rw-r--r-- | src/effects/cnn_v2_effect.h (renamed from src/gpu/effects/cnn_v2_effect.h) | 0 | ||||
| -rw-r--r-- | src/effects/distort_effect.cc (renamed from src/gpu/effects/distort_effect.cc) | 0 | ||||
| -rw-r--r-- | src/effects/fade_effect.cc (renamed from src/gpu/effects/fade_effect.cc) | 4 | ||||
| -rw-r--r-- | src/effects/fade_effect.h (renamed from src/gpu/effects/fade_effect.h) | 2 | ||||
| -rw-r--r-- | src/effects/flash_cube_effect.cc (renamed from src/gpu/effects/flash_cube_effect.cc) | 2 | ||||
| -rw-r--r-- | src/effects/flash_cube_effect.h (renamed from src/gpu/effects/flash_cube_effect.h) | 0 | ||||
| -rw-r--r-- | src/effects/flash_effect.cc (renamed from src/gpu/effects/flash_effect.cc) | 4 | ||||
| -rw-r--r-- | src/effects/flash_effect.h (renamed from src/gpu/effects/flash_effect.h) | 0 | ||||
| -rw-r--r-- | src/effects/gaussian_blur_effect.cc (renamed from src/gpu/effects/gaussian_blur_effect.cc) | 2 | ||||
| -rw-r--r-- | src/effects/heptagon_effect.cc (renamed from src/gpu/effects/heptagon_effect.cc) | 0 | ||||
| -rw-r--r-- | src/effects/hybrid_3d_effect.cc (renamed from src/gpu/effects/hybrid_3d_effect.cc) | 2 | ||||
| -rw-r--r-- | src/effects/hybrid_3d_effect.h (renamed from src/gpu/effects/hybrid_3d_effect.h) | 0 | ||||
| -rw-r--r-- | src/effects/moving_ellipse_effect.cc (renamed from src/gpu/effects/moving_ellipse_effect.cc) | 2 | ||||
| -rw-r--r-- | src/effects/particle_spray_effect.cc (renamed from src/gpu/effects/particle_spray_effect.cc) | 2 | ||||
| -rw-r--r-- | src/effects/particles_effect.cc (renamed from src/gpu/effects/particles_effect.cc) | 2 | ||||
| -rw-r--r-- | src/effects/passthrough_effect.cc (renamed from src/gpu/effects/passthrough_effect.cc) | 0 | ||||
| -rw-r--r-- | src/effects/rotating_cube_effect.cc (renamed from src/gpu/effects/rotating_cube_effect.cc) | 6 | ||||
| -rw-r--r-- | src/effects/rotating_cube_effect.h (renamed from src/gpu/effects/rotating_cube_effect.h) | 0 | ||||
| -rw-r--r-- | src/effects/scene1_effect.cc (renamed from src/gpu/effects/scene1_effect.cc) | 0 | ||||
| -rw-r--r-- | src/effects/scene1_effect.h (renamed from src/gpu/effects/scene1_effect.h) | 0 | ||||
| -rw-r--r-- | src/effects/solarize_effect.cc (renamed from src/gpu/effects/solarize_effect.cc) | 0 | ||||
| -rw-r--r-- | src/effects/theme_modulation_effect.cc (renamed from src/gpu/effects/theme_modulation_effect.cc) | 6 | ||||
| -rw-r--r-- | src/effects/theme_modulation_effect.h (renamed from src/gpu/effects/theme_modulation_effect.h) | 2 | ||||
| -rw-r--r-- | src/effects/vignette_effect.cc (renamed from src/gpu/effects/vignette_effect.cc) | 2 | ||||
| -rw-r--r-- | src/gpu/demo_effects.cc | 4 | ||||
| -rw-r--r-- | src/gpu/demo_effects.h | 28 | ||||
| -rw-r--r-- | src/gpu/effect.h | 2 | ||||
| -rw-r--r-- | src/gpu/gpu.cc | 9 | ||||
| -rw-r--r-- | src/gpu/pipeline_builder.h | 2 | ||||
| -rw-r--r-- | src/gpu/post_process_helper.cc (renamed from src/gpu/effects/post_process_helper.cc) | 4 | ||||
| -rw-r--r-- | src/gpu/post_process_helper.h (renamed from src/gpu/effects/post_process_helper.h) | 0 | ||||
| -rw-r--r-- | src/gpu/shader_composer.cc (renamed from src/gpu/effects/shader_composer.cc) | 2 | ||||
| -rw-r--r-- | src/gpu/shader_composer.h (renamed from src/gpu/effects/shader_composer.h) | 0 | ||||
| -rw-r--r-- | src/gpu/shaders.cc (renamed from src/gpu/effects/shaders.cc) | 4 | ||||
| -rw-r--r-- | src/gpu/shaders.h (renamed from src/gpu/effects/shaders.h) | 0 | ||||
| -rw-r--r-- | src/gpu/texture_manager.cc | 2 | ||||
| -rw-r--r-- | src/tests/3d/test_3d_physics.cc | 2 | ||||
| -rw-r--r-- | src/tests/3d/test_3d_render.cc | 2 | ||||
| -rw-r--r-- | src/tests/3d/test_mesh.cc | 2 | ||||
| -rw-r--r-- | src/tests/gpu/test_demo_effects.cc | 2 | ||||
| -rw-r--r-- | src/tests/gpu/test_noise_functions.cc | 4 | ||||
| -rw-r--r-- | src/tests/gpu/test_shader_compilation.cc | 4 | ||||
| -rw-r--r-- | src/tests/gpu/test_shader_composer.cc | 2 | ||||
| -rw-r--r-- | tools/cnn_test.cc | 8 | ||||
| -rw-r--r-- | tools/cnn_v2_test/README.md | 2 | ||||
| -rw-r--r-- | tools/shadertoy/README.md | 10 | ||||
| -rwxr-xr-x | tools/shadertoy/convert_shadertoy.py | 20 | ||||
| -rw-r--r-- | tools/shadertoy/template.cc | 4 | ||||
| -rw-r--r-- | tools/shadertoy/template.h | 2 |
68 files changed, 131 insertions, 136 deletions
diff --git a/cmake/DemoSourceLists.cmake b/cmake/DemoSourceLists.cmake index f1fbf4a..a54eb4b 100644 --- a/cmake/DemoSourceLists.cmake +++ b/cmake/DemoSourceLists.cmake @@ -29,11 +29,11 @@ set(UTIL_SOURCES src/util/asset_manager.cc src/util/file_watcher.cc) # GPU sources (conditional: HEADLESS / STRIP_EXTERNAL / NORMAL) demo_set_conditional_sources(GPU_SOURCES # Headless mode: Functional stubs (timeline/audio work) - "src/gpu/headless_gpu.cc;src/gpu/demo_effects.cc;src/gpu/effect.cc;src/gpu/effects/heptagon_effect.cc;src/gpu/effects/particles_effect.cc;src/gpu/effects/passthrough_effect.cc;src/gpu/effects/moving_ellipse_effect.cc;src/gpu/effects/particle_spray_effect.cc;src/gpu/effects/gaussian_blur_effect.cc;src/gpu/effects/solarize_effect.cc;src/gpu/effects/scene1_effect.cc;src/gpu/effects/chroma_aberration_effect.cc;src/gpu/effects/vignette_effect.cc;src/gpu/effects/cnn_effect.cc;src/gpu/effects/cnn_v2_effect.cc;src/gpu/effects/post_process_helper.cc;src/gpu/effects/shaders.cc;src/gpu/effects/hybrid_3d_effect.cc;src/gpu/effects/flash_cube_effect.cc;src/gpu/effects/theme_modulation_effect.cc;src/gpu/effects/fade_effect.cc;src/gpu/effects/flash_effect.cc;src/gpu/effects/shader_composer.cc;src/gpu/effects/circle_mask_effect.cc;src/gpu/effects/rotating_cube_effect.cc;src/gpu/texture_manager.cc;src/gpu/texture_readback.cc" + "src/gpu/headless_gpu.cc;src/gpu/demo_effects.cc;src/gpu/effect.cc;src/effects/heptagon_effect.cc;src/effects/particles_effect.cc;src/effects/passthrough_effect.cc;src/effects/moving_ellipse_effect.cc;src/effects/particle_spray_effect.cc;src/effects/gaussian_blur_effect.cc;src/effects/solarize_effect.cc;src/effects/scene1_effect.cc;src/effects/chroma_aberration_effect.cc;src/effects/vignette_effect.cc;src/effects/cnn_effect.cc;src/effects/cnn_v2_effect.cc;src/gpu/post_process_helper.cc;src/gpu/shaders.cc;src/effects/hybrid_3d_effect.cc;src/effects/flash_cube_effect.cc;src/effects/theme_modulation_effect.cc;src/effects/fade_effect.cc;src/effects/flash_effect.cc;src/gpu/shader_composer.cc;src/effects/circle_mask_effect.cc;src/effects/rotating_cube_effect.cc;src/gpu/texture_manager.cc;src/gpu/texture_readback.cc" # Strip mode: Minimal GPU stubs only "src/gpu/stub_gpu.cc" # Normal mode: Full GPU implementation - "src/gpu/gpu.cc;src/gpu/effect.cc;src/gpu/effects/heptagon_effect.cc;src/gpu/effects/particles_effect.cc;src/gpu/effects/passthrough_effect.cc;src/gpu/effects/moving_ellipse_effect.cc;src/gpu/effects/particle_spray_effect.cc;src/gpu/effects/gaussian_blur_effect.cc;src/gpu/effects/solarize_effect.cc;src/gpu/effects/scene1_effect.cc;src/gpu/effects/chroma_aberration_effect.cc;src/gpu/effects/vignette_effect.cc;src/gpu/effects/cnn_effect.cc;src/gpu/effects/cnn_v2_effect.cc;src/gpu/effects/post_process_helper.cc;src/gpu/effects/shaders.cc;src/gpu/effects/hybrid_3d_effect.cc;src/gpu/effects/flash_cube_effect.cc;src/gpu/effects/theme_modulation_effect.cc;src/gpu/effects/fade_effect.cc;src/gpu/effects/flash_effect.cc;src/gpu/effects/shader_composer.cc;src/gpu/effects/circle_mask_effect.cc;src/gpu/effects/rotating_cube_effect.cc;src/gpu/texture_manager.cc;src/gpu/texture_readback.cc" + "src/gpu/gpu.cc;src/gpu/effect.cc;src/effects/heptagon_effect.cc;src/effects/particles_effect.cc;src/effects/passthrough_effect.cc;src/effects/moving_ellipse_effect.cc;src/effects/particle_spray_effect.cc;src/effects/gaussian_blur_effect.cc;src/effects/solarize_effect.cc;src/effects/scene1_effect.cc;src/effects/chroma_aberration_effect.cc;src/effects/vignette_effect.cc;src/effects/cnn_effect.cc;src/effects/cnn_v2_effect.cc;src/gpu/post_process_helper.cc;src/gpu/shaders.cc;src/effects/hybrid_3d_effect.cc;src/effects/flash_cube_effect.cc;src/effects/theme_modulation_effect.cc;src/effects/fade_effect.cc;src/effects/flash_effect.cc;src/gpu/shader_composer.cc;src/effects/circle_mask_effect.cc;src/effects/rotating_cube_effect.cc;src/gpu/texture_manager.cc;src/gpu/texture_readback.cc" ) # 3D sources (conditional: HEADLESS / STRIP_EXTERNAL / NORMAL) diff --git a/cmake/Validation.cmake b/cmake/Validation.cmake index 1152d1a..328357e 100644 --- a/cmake/Validation.cmake +++ b/cmake/Validation.cmake @@ -12,16 +12,16 @@ file(GLOB WGSL_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE # List of C++ files containing uniform struct definitions and shader code # Add more C++ files here if new effects with structs are added. set(VALIDATION_CPP_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/heptagon_effect.cc - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/post_process_helper.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/fade_effect.cc - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/theme_modulation_effect.cc - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/chroma_aberration_effect.cc - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/vignette_effect.cc - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/gaussian_blur_effect.cc - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/distort_effect.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/heptagon_effect.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/post_process_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/fade_effect.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/theme_modulation_effect.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/chroma_aberration_effect.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/vignette_effect.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/gaussian_blur_effect.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/distort_effect.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/demo_effects.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/effects/circle_mask_effect.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/effects/circle_mask_effect.h ) # Add custom command to run the validator 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_name>_effect.h` -- Implementation: `src/gpu/effects/<effect_name>_effect.cc` +- Header: `src/effects/<effect_name>_effect.h` +- Implementation: `src/effects/<effect_name>_effect.cc` - Shader: `workspaces/main/shaders/<effect_name>.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_name>_effect.cc` to **BOTH** GPU_SOURCES sections: +**Action:** Add `src/effects/<effect_name>_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_name>_effect.h" +#include "effects/<effect_name>_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<f32>) -> vec4<f32> { )"); ``` -**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 diff --git a/src/3d/renderer.cc b/src/3d/renderer.cc index d846895..7f2f800 100644 --- a/src/3d/renderer.cc +++ b/src/3d/renderer.cc @@ -3,7 +3,7 @@ #include "3d/renderer.h" #include "generated/assets.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include "util/asset_manager.h" #include <algorithm> #include <cassert> diff --git a/src/3d/renderer_pipelines.cc b/src/3d/renderer_pipelines.cc index 54499af..fed3983 100644 --- a/src/3d/renderer_pipelines.cc +++ b/src/3d/renderer_pipelines.cc @@ -3,7 +3,7 @@ #include "3d/renderer.h" #include "generated/assets.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include "util/asset_manager.h" #include "util/asset_manager_utils.h" #include <vector> diff --git a/src/app/test_demo.cc b/src/app/test_demo.cc index 7f10c3b..2a91d37 100644 --- a/src/app/test_demo.cc +++ b/src/app/test_demo.cc @@ -20,10 +20,10 @@ extern float GetDemoDuration(); extern void LoadTimeline(MainSequence& main_seq, const GpuContext& ctx); // Inline peak meter effect for debugging audio-visual sync -#include "gpu/effects/post_process_helper.h" -#include "gpu/effects/shader_composer.h" -#include "gpu/effects/cnn_effect.h" -#include "gpu/effects/cnn_v2_effect.h" +#include "gpu/post_process_helper.h" +#include "gpu/shader_composer.h" +#include "effects/cnn_effect.h" +#include "effects/cnn_v2_effect.h" class PeakMeterEffect : public PostProcessEffect { public: diff --git a/src/gpu/effects/chroma_aberration_effect.cc b/src/effects/chroma_aberration_effect.cc index 3a51965..a096f5b 100644 --- a/src/gpu/effects/chroma_aberration_effect.cc +++ b/src/effects/chroma_aberration_effect.cc @@ -2,7 +2,7 @@ // It implements the ChromaAberrationEffect with parameterization. #include "gpu/demo_effects.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" // --- ChromaAberrationEffect --- diff --git a/src/gpu/effects/circle_mask_effect.cc b/src/effects/circle_mask_effect.cc index dfe7d03..63c8f68 100644 --- a/src/gpu/effects/circle_mask_effect.cc +++ b/src/effects/circle_mask_effect.cc @@ -2,10 +2,10 @@ // It implements CircleMaskEffect for auxiliary texture masking demonstration. // Generates circular mask and renders green background outside circle. -#include "gpu/effects/circle_mask_effect.h" +#include "effects/circle_mask_effect.h" #include "generated/assets.h" #include "gpu/bind_group_builder.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" CircleMaskEffect::CircleMaskEffect(const GpuContext& ctx, float radius) : Effect(ctx), radius_(radius) { diff --git a/src/gpu/effects/circle_mask_effect.h b/src/effects/circle_mask_effect.h index 6ebaca1..53cc1bc 100644 --- a/src/gpu/effects/circle_mask_effect.h +++ b/src/effects/circle_mask_effect.h @@ -6,7 +6,7 @@ #define CIRCLE_MASK_EFFECT_H_ #include "gpu/effect.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/uniform_helper.h" class CircleMaskEffect : public Effect { diff --git a/src/gpu/effects/cnn_effect.cc b/src/effects/cnn_effect.cc index 83a3365..4475180 100644 --- a/src/gpu/effects/cnn_effect.cc +++ b/src/effects/cnn_effect.cc @@ -1,10 +1,10 @@ // CNN post-processing effect implementation // Neural network-based stylization with modular WGSL -#include "gpu/effects/cnn_effect.h" -#include "gpu/effects/post_process_helper.h" -#include "gpu/effects/shaders.h" -#include "gpu/effects/shader_composer.h" +#include "effects/cnn_effect.h" +#include "gpu/post_process_helper.h" +#include "gpu/shaders.h" +#include "gpu/shader_composer.h" #include "gpu/effect.h" #include "gpu/bind_group_builder.h" #include "gpu/sampler_cache.h" diff --git a/src/gpu/effects/cnn_effect.h b/src/effects/cnn_effect.h index 3e2b7ca..3e2b7ca 100644 --- a/src/gpu/effects/cnn_effect.h +++ b/src/effects/cnn_effect.h diff --git a/src/gpu/effects/cnn_v2_effect.cc b/src/effects/cnn_v2_effect.cc index be856a4..4c10ed1 100644 --- a/src/gpu/effects/cnn_v2_effect.cc +++ b/src/effects/cnn_v2_effect.cc @@ -1,6 +1,6 @@ // CNN v2 Effect Implementation -#include "gpu/effects/cnn_v2_effect.h" +#include "effects/cnn_v2_effect.h" #if defined(USE_TEST_ASSETS) #include "test_assets.h" @@ -153,7 +153,7 @@ void CNNv2Effect::create_textures() { // Input texture with mips (for multi-scale features) TextureWithView input_mip = gpu_create_texture_2d( ctx_.device, width_, height_, WGPUTextureFormat_RGBA8Unorm, - WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopyDst, 3); + (WGPUTextureUsage)(WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopyDst), 3); input_mip_tex_ = input_mip.texture; for (int i = 0; i < 3; ++i) { diff --git a/src/gpu/effects/cnn_v2_effect.h b/src/effects/cnn_v2_effect.h index d530d3b..d530d3b 100644 --- a/src/gpu/effects/cnn_v2_effect.h +++ b/src/effects/cnn_v2_effect.h diff --git a/src/gpu/effects/distort_effect.cc b/src/effects/distort_effect.cc index 97622b2..97622b2 100644 --- a/src/gpu/effects/distort_effect.cc +++ b/src/effects/distort_effect.cc diff --git a/src/gpu/effects/fade_effect.cc b/src/effects/fade_effect.cc index 93684d8..fd2af69 100644 --- a/src/gpu/effects/fade_effect.cc +++ b/src/effects/fade_effect.cc @@ -1,8 +1,8 @@ // This file is part of the 64k demo project. // It implements the FadeEffect - fades to/from black based on time. -#include "gpu/effects/fade_effect.h" -#include "gpu/effects/post_process_helper.h" +#include "effects/fade_effect.h" +#include "gpu/post_process_helper.h" #include <cmath> struct FadeParams { diff --git a/src/gpu/effects/fade_effect.h b/src/effects/fade_effect.h index 3360a5f..8cd7006 100644 --- a/src/gpu/effects/fade_effect.h +++ b/src/effects/fade_effect.h @@ -4,7 +4,7 @@ #pragma once #include "gpu/effect.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" #include "gpu/uniform_helper.h" diff --git a/src/gpu/effects/flash_cube_effect.cc b/src/effects/flash_cube_effect.cc index 506f11c..29e9897 100644 --- a/src/gpu/effects/flash_cube_effect.cc +++ b/src/effects/flash_cube_effect.cc @@ -2,7 +2,7 @@ // It implements the FlashCubeEffect - a flashing background cube with Perlin // noise. -#include "gpu/effects/flash_cube_effect.h" +#include "effects/flash_cube_effect.h" #include "generated/assets.h" #include "util/asset_manager_utils.h" #include <cmath> diff --git a/src/gpu/effects/flash_cube_effect.h b/src/effects/flash_cube_effect.h index df30b5b..df30b5b 100644 --- a/src/gpu/effects/flash_cube_effect.h +++ b/src/effects/flash_cube_effect.h diff --git a/src/gpu/effects/flash_effect.cc b/src/effects/flash_effect.cc index e53cbce..235412d 100644 --- a/src/gpu/effects/flash_effect.cc +++ b/src/effects/flash_effect.cc @@ -2,8 +2,8 @@ // It implements the FlashEffect - brief flash on u.beat hits. // Now supports parameterized color with per-frame animation. -#include "gpu/effects/flash_effect.h" -#include "gpu/effects/post_process_helper.h" +#include "effects/flash_effect.h" +#include "gpu/post_process_helper.h" #include <cmath> // Backward compatibility constructor (delegates to parameterized constructor) diff --git a/src/gpu/effects/flash_effect.h b/src/effects/flash_effect.h index 1ac75a4..1ac75a4 100644 --- a/src/gpu/effects/flash_effect.h +++ b/src/effects/flash_effect.h diff --git a/src/gpu/effects/gaussian_blur_effect.cc b/src/effects/gaussian_blur_effect.cc index 4421e33..0b4beae 100644 --- a/src/gpu/effects/gaussian_blur_effect.cc +++ b/src/effects/gaussian_blur_effect.cc @@ -2,7 +2,7 @@ // It implements the GaussianBlurEffect with parameterization. #include "gpu/demo_effects.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" // --- GaussianBlurEffect --- diff --git a/src/gpu/effects/heptagon_effect.cc b/src/effects/heptagon_effect.cc index 724eabb..724eabb 100644 --- a/src/gpu/effects/heptagon_effect.cc +++ b/src/effects/heptagon_effect.cc diff --git a/src/gpu/effects/hybrid_3d_effect.cc b/src/effects/hybrid_3d_effect.cc index a46ab4c..1cd773d 100644 --- a/src/gpu/effects/hybrid_3d_effect.cc +++ b/src/effects/hybrid_3d_effect.cc @@ -1,7 +1,7 @@ // This file is part of the 64k demo project. // It implements the Hybrid3DEffect. -#include "gpu/effects/hybrid_3d_effect.h" +#include "effects/hybrid_3d_effect.h" #include "generated/assets.h" #include "util/asset_manager_utils.h" #include <cassert> diff --git a/src/gpu/effects/hybrid_3d_effect.h b/src/effects/hybrid_3d_effect.h index 818b65c..818b65c 100644 --- a/src/gpu/effects/hybrid_3d_effect.h +++ b/src/effects/hybrid_3d_effect.h diff --git a/src/gpu/effects/moving_ellipse_effect.cc b/src/effects/moving_ellipse_effect.cc index bbd3c08..f595de9 100644 --- a/src/gpu/effects/moving_ellipse_effect.cc +++ b/src/effects/moving_ellipse_effect.cc @@ -2,7 +2,7 @@ // It implements the MovingEllipseEffect. #include "gpu/demo_effects.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" // --- MovingEllipseEffect --- diff --git a/src/gpu/effects/particle_spray_effect.cc b/src/effects/particle_spray_effect.cc index 9b615d0..e250f5a 100644 --- a/src/gpu/effects/particle_spray_effect.cc +++ b/src/effects/particle_spray_effect.cc @@ -2,7 +2,7 @@ // It implements the ParticleSprayEffect. #include "gpu/demo_effects.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" #include <vector> diff --git a/src/gpu/effects/particles_effect.cc b/src/effects/particles_effect.cc index f8c18f0..5762637 100644 --- a/src/gpu/effects/particles_effect.cc +++ b/src/effects/particles_effect.cc @@ -2,7 +2,7 @@ // It implements the ParticlesEffect. #include "gpu/demo_effects.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" #include <vector> diff --git a/src/gpu/effects/passthrough_effect.cc b/src/effects/passthrough_effect.cc index aedb387..aedb387 100644 --- a/src/gpu/effects/passthrough_effect.cc +++ b/src/effects/passthrough_effect.cc diff --git a/src/gpu/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 96b02f1..a42feaa 100644 --- a/src/gpu/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -2,10 +2,10 @@ // It implements RotatingCubeEffect for bump-mapped rotating cube rendering. // Uses auxiliary texture masking to render only inside a circular region. -#include "gpu/effects/rotating_cube_effect.h" +#include "effects/rotating_cube_effect.h" #include "generated/assets.h" #include "gpu/bind_group_builder.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include "gpu/gpu.h" #include "gpu/sampler_cache.h" #include "util/asset_manager_utils.h" @@ -39,7 +39,7 @@ void RotatingCubeEffect::init(MainSequence* demo) { TextureWithView noise = gpu_create_texture_2d( ctx_.device, 1, 1, WGPUTextureFormat_RGBA8Unorm, - WGPUTextureUsage_TextureBinding | WGPUTextureUsage_RenderAttachment, 1); + (WGPUTextureUsage)(WGPUTextureUsage_TextureBinding | WGPUTextureUsage_RenderAttachment), 1); noise_texture_ = noise.texture; noise_view_ = noise.view; diff --git a/src/gpu/effects/rotating_cube_effect.h b/src/effects/rotating_cube_effect.h index fdf67ab..fdf67ab 100644 --- a/src/gpu/effects/rotating_cube_effect.h +++ b/src/effects/rotating_cube_effect.h diff --git a/src/gpu/effects/scene1_effect.cc b/src/effects/scene1_effect.cc index c75e511..c75e511 100644 --- a/src/gpu/effects/scene1_effect.cc +++ b/src/effects/scene1_effect.cc diff --git a/src/gpu/effects/scene1_effect.h b/src/effects/scene1_effect.h index 190ffa9..190ffa9 100644 --- a/src/gpu/effects/scene1_effect.h +++ b/src/effects/scene1_effect.h diff --git a/src/gpu/effects/solarize_effect.cc b/src/effects/solarize_effect.cc index cdb9354..cdb9354 100644 --- a/src/gpu/effects/solarize_effect.cc +++ b/src/effects/solarize_effect.cc diff --git a/src/gpu/effects/theme_modulation_effect.cc b/src/effects/theme_modulation_effect.cc index aff6bce..1c81d79 100644 --- a/src/gpu/effects/theme_modulation_effect.cc +++ b/src/effects/theme_modulation_effect.cc @@ -1,9 +1,9 @@ // This file is part of the 64k demo project. // It implements theme modulation (bright/dark alternation). -#include "gpu/effects/theme_modulation_effect.h" -#include "gpu/effects/post_process_helper.h" -#include "gpu/effects/shaders.h" +#include "effects/theme_modulation_effect.h" +#include "gpu/post_process_helper.h" +#include "gpu/shaders.h" #include <cmath> struct ThemeModulationParams { diff --git a/src/gpu/effects/theme_modulation_effect.h b/src/effects/theme_modulation_effect.h index 31e96e6..e4d4e0a 100644 --- a/src/gpu/effects/theme_modulation_effect.h +++ b/src/effects/theme_modulation_effect.h @@ -5,7 +5,7 @@ #pragma once #include "gpu/effect.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/uniform_helper.h" class ThemeModulationEffect : public PostProcessEffect { diff --git a/src/gpu/effects/vignette_effect.cc b/src/effects/vignette_effect.cc index 4b0ffe2..0e5f68f 100644 --- a/src/gpu/effects/vignette_effect.cc +++ b/src/effects/vignette_effect.cc @@ -2,7 +2,7 @@ // It implements the VignetteEffect. #include "gpu/demo_effects.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" VignetteEffect::VignetteEffect(const GpuContext& ctx) diff --git a/src/gpu/demo_effects.cc b/src/gpu/demo_effects.cc index 069d36c..3acf287 100644 --- a/src/gpu/demo_effects.cc +++ b/src/gpu/demo_effects.cc @@ -3,8 +3,8 @@ // Its content has been split into individual effect files and helper files. #include "gpu/demo_effects.h" -#include "gpu/effects/circle_mask_effect.h" -#include "gpu/effects/rotating_cube_effect.h" +#include "effects/circle_mask_effect.h" +#include "effects/rotating_cube_effect.h" // Auto-generated function to populate the timeline void LoadTimeline(MainSequence& main_seq, WGPUDevice device, WGPUQueue queue, diff --git a/src/gpu/demo_effects.h b/src/gpu/demo_effects.h index d0ae748..beadafb 100644 --- a/src/gpu/demo_effects.h +++ b/src/gpu/demo_effects.h @@ -6,16 +6,16 @@ #include "3d/renderer.h" #include "3d/scene.h" #include "effect.h" -#include "gpu/effects/circle_mask_effect.h" -#include "gpu/effects/fade_effect.h" // FadeEffect with full definition -#include "gpu/effects/flash_effect.h" // FlashEffect with params support -#include "gpu/effects/post_process_helper.h" -#include "gpu/effects/rotating_cube_effect.h" -#include "gpu/effects/shaders.h" -#include "gpu/effects/theme_modulation_effect.h" // ThemeModulationEffect with full definition -#include "gpu/effects/hybrid_3d_effect.h" -#include "gpu/effects/flash_cube_effect.h" -#include "gpu/effects/scene1_effect.h" +#include "effects/circle_mask_effect.h" +#include "effects/fade_effect.h" // FadeEffect with full definition +#include "effects/flash_effect.h" // FlashEffect with params support +#include "gpu/post_process_helper.h" +#include "effects/rotating_cube_effect.h" +#include "gpu/shaders.h" +#include "effects/theme_modulation_effect.h" // ThemeModulationEffect with full definition +#include "effects/hybrid_3d_effect.h" +#include "effects/flash_cube_effect.h" +#include "effects/scene1_effect.h" #include "gpu/gpu.h" #include "gpu/texture_manager.h" #include "gpu/uniform_helper.h" @@ -180,13 +180,9 @@ class DistortEffect : public PostProcessEffect { UniformBuffer<DistortParams> params_buffer_; }; -// ThemeModulationEffect now defined in gpu/effects/theme_modulation_effect.h -// (included above) FadeEffect now defined in gpu/effects/fade_effect.h -// (included above) FlashEffect now defined in gpu/effects/flash_effect.h -// (included above) -#include "gpu/effects/cnn_effect.h" -#include "gpu/effects/cnn_v2_effect.h" +#include "effects/cnn_effect.h" +#include "effects/cnn_v2_effect.h" // Auto-generated functions void LoadTimeline(MainSequence& main_seq, const GpuContext& ctx); diff --git a/src/gpu/effect.h b/src/gpu/effect.h index b9709a4..5d835ad 100644 --- a/src/gpu/effect.h +++ b/src/gpu/effect.h @@ -1,6 +1,6 @@ #pragma once #include "gpu/gpu.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/uniform_helper.h" #include <algorithm> #include <map> diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index afbba90..929a063 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -4,8 +4,8 @@ #include "gpu.h" #include "effect.h" -#include "gpu/effects/shaders.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shaders.h" +#include "gpu/shader_composer.h" #include "platform/platform.h" #include <cassert> @@ -81,7 +81,7 @@ TextureWithView gpu_create_storage_texture_2d(WGPUDevice device, uint32_t width, WGPUTextureFormat format) { return gpu_create_texture_2d( device, width, height, format, - WGPUTextureUsage_StorageBinding | WGPUTextureUsage_TextureBinding, 1); + (WGPUTextureUsage)(WGPUTextureUsage_StorageBinding | WGPUTextureUsage_TextureBinding), 1); } TextureWithView gpu_create_post_process_texture(WGPUDevice device, @@ -89,8 +89,7 @@ TextureWithView gpu_create_post_process_texture(WGPUDevice device, WGPUTextureFormat format) { return gpu_create_texture_2d( device, width, height, format, - WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_TextureBinding | - WGPUTextureUsage_CopySrc, + (WGPUTextureUsage)(WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopySrc), 1); } diff --git a/src/gpu/pipeline_builder.h b/src/gpu/pipeline_builder.h index 06b4ceb..68e34ea 100644 --- a/src/gpu/pipeline_builder.h +++ b/src/gpu/pipeline_builder.h @@ -14,7 +14,7 @@ struct WGPUShaderModuleImpl; typedef struct WGPUShaderModuleImpl* WGPUShaderModule; #include "platform/platform.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" class RenderPipelineBuilder { WGPUDevice device_; diff --git a/src/gpu/effects/post_process_helper.cc b/src/gpu/post_process_helper.cc index 0c339c7..4ffa9c1 100644 --- a/src/gpu/effects/post_process_helper.cc +++ b/src/gpu/post_process_helper.cc @@ -2,9 +2,9 @@ // It implements helper functions for post-processing effects. #include "post_process_helper.h" -#include "../demo_effects.h" +#include "demo_effects.h" #include "gpu/gpu.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include "gpu/bind_group_builder.h" #include "gpu/sampler_cache.h" #include "gpu/pipeline_builder.h" diff --git a/src/gpu/effects/post_process_helper.h b/src/gpu/post_process_helper.h index 1c649e7..1c649e7 100644 --- a/src/gpu/effects/post_process_helper.h +++ b/src/gpu/post_process_helper.h diff --git a/src/gpu/effects/shader_composer.cc b/src/gpu/shader_composer.cc index 9234b7a..fce6de4 100644 --- a/src/gpu/effects/shader_composer.cc +++ b/src/gpu/shader_composer.cc @@ -1,7 +1,7 @@ // This file is part of the 64k demo project. // It implements the ShaderComposer class. -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include <set> #include <sstream> diff --git a/src/gpu/effects/shader_composer.h b/src/gpu/shader_composer.h index d0972f2..d0972f2 100644 --- a/src/gpu/effects/shader_composer.h +++ b/src/gpu/shader_composer.h diff --git a/src/gpu/effects/shaders.cc b/src/gpu/shaders.cc index d79f3d3..903b96e 100644 --- a/src/gpu/effects/shaders.cc +++ b/src/gpu/shaders.cc @@ -1,7 +1,7 @@ // This file is part of the 64k demo project. // It defines WGSL shader code for various effects. -#include "../demo_effects.h" +#include "demo_effects.h" #if defined(USE_TEST_ASSETS) @@ -13,7 +13,7 @@ #endif -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include "util/asset_manager.h" diff --git a/src/gpu/effects/shaders.h b/src/gpu/shaders.h index 03fa48c..03fa48c 100644 --- a/src/gpu/effects/shaders.h +++ b/src/gpu/shaders.h diff --git a/src/gpu/texture_manager.cc b/src/gpu/texture_manager.cc index d5821ee..7889283 100644 --- a/src/gpu/texture_manager.cc +++ b/src/gpu/texture_manager.cc @@ -2,7 +2,7 @@ // It implements the TextureManager. #include "gpu/texture_manager.h" -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include "platform/platform.h" #include <cstdio> #include <cstring> diff --git a/src/tests/3d/test_3d_physics.cc b/src/tests/3d/test_3d_physics.cc index 9b8bf11..9e4f71b 100644 --- a/src/tests/3d/test_3d_physics.cc +++ b/src/tests/3d/test_3d_physics.cc @@ -8,7 +8,7 @@ #include "3d/renderer.h" #include "3d/renderer_helpers.h" #include "3d/scene.h" -#include "gpu/effects/shaders.h" +#include "gpu/shaders.h" #include "gpu/texture_manager.h" #include "platform/platform.h" #include "procedural/generator.h" diff --git a/src/tests/3d/test_3d_render.cc b/src/tests/3d/test_3d_render.cc index 87d7b76..10de907 100644 --- a/src/tests/3d/test_3d_render.cc +++ b/src/tests/3d/test_3d_render.cc @@ -7,7 +7,7 @@ #include "3d/renderer_helpers.h" #include "3d/scene.h" #include "generated/assets.h" -#include "gpu/effects/shaders.h" +#include "gpu/shaders.h" #include "gpu/texture_manager.h" #include "platform/platform.h" #include "procedural/generator.h" diff --git a/src/tests/3d/test_mesh.cc b/src/tests/3d/test_mesh.cc index 4a1d97b..d4ce097 100644 --- a/src/tests/3d/test_mesh.cc +++ b/src/tests/3d/test_mesh.cc @@ -6,7 +6,7 @@ #include "3d/renderer.h" #include "3d/renderer_helpers.h" #include "3d/scene.h" -#include "gpu/effects/shaders.h" +#include "gpu/shaders.h" #include "gpu/texture_manager.h" #include "platform/platform.h" #include "procedural/generator.h" diff --git a/src/tests/gpu/test_demo_effects.cc b/src/tests/gpu/test_demo_effects.cc index 169db91..7c61691 100644 --- a/src/tests/gpu/test_demo_effects.cc +++ b/src/tests/gpu/test_demo_effects.cc @@ -13,7 +13,7 @@ #include "../common/effect_test_helpers.h" #include "gpu/demo_effects.h" #include "gpu/effect.h" -#include "gpu/effects/cnn_effect.h" +#include "effects/cnn_effect.h" #include "../common/webgpu_test_fixture.h" #include <cassert> #include <cstdio> diff --git a/src/tests/gpu/test_noise_functions.cc b/src/tests/gpu/test_noise_functions.cc index f8dfc93..eddd88e 100644 --- a/src/tests/gpu/test_noise_functions.cc +++ b/src/tests/gpu/test_noise_functions.cc @@ -2,8 +2,8 @@ // It validates that the noise.wgsl functions are accessible and usable. #include "generated/assets.h" -#include "gpu/effects/shader_composer.h" -#include "gpu/effects/shaders.h" +#include "gpu/shader_composer.h" +#include "gpu/shaders.h" #include <cassert> #include <cstdio> #include <cstring> diff --git a/src/tests/gpu/test_shader_compilation.cc b/src/tests/gpu/test_shader_compilation.cc index a322e8a..3a7c2cf 100644 --- a/src/tests/gpu/test_shader_compilation.cc +++ b/src/tests/gpu/test_shader_compilation.cc @@ -6,8 +6,8 @@ // - Type mismatches #include "generated/assets.h" -#include "gpu/effects/shader_composer.h" -#include "gpu/effects/shaders.h" +#include "gpu/shader_composer.h" +#include "gpu/shaders.h" #include "platform/platform.h" #include <cassert> #include <cstdio> diff --git a/src/tests/gpu/test_shader_composer.cc b/src/tests/gpu/test_shader_composer.cc index a98a259..a23d6fa 100644 --- a/src/tests/gpu/test_shader_composer.cc +++ b/src/tests/gpu/test_shader_composer.cc @@ -1,7 +1,7 @@ // This file is part of the 64k demo project. // It tests the ShaderComposer utility. -#include "gpu/effects/shader_composer.h" +#include "gpu/shader_composer.h" #include <cassert> #include <iostream> #include <string> diff --git a/tools/cnn_test.cc b/tools/cnn_test.cc index 1d736d9..740f41d 100644 --- a/tools/cnn_test.cc +++ b/tools/cnn_test.cc @@ -11,10 +11,10 @@ #include "gpu/pipeline_builder.h" #include "gpu/sampler_cache.h" #include "gpu/texture_readback.h" -#include "gpu/effects/post_process_helper.h" -#include "gpu/effects/cnn_effect.h" -#include "gpu/effects/shader_composer.h" -#include "gpu/effects/shaders.h" +#include "gpu/post_process_helper.h" +#include "effects/cnn_effect.h" +#include "gpu/shader_composer.h" +#include "gpu/shaders.h" #include "tests/common/webgpu_test_fixture.h" #include "tests/common/offscreen_render_target.h" #include "generated/assets.h" diff --git a/tools/cnn_v2_test/README.md b/tools/cnn_v2_test/README.md index b9439e5..d41a00f 100644 --- a/tools/cnn_v2_test/README.md +++ b/tools/cnn_v2_test/README.md @@ -248,4 +248,4 @@ Planned enhancements: - `doc/CNN_V2.md` - Architecture and design - `doc/HOWTO.md` - Training workflows - `training/export_cnn_v2_weights.py` - Binary format -- `src/gpu/effects/cnn_v2_effect.cc` - C++ reference implementation +- `src/effects/cnn_v2_effect.cc` - C++ reference implementation diff --git a/tools/shadertoy/README.md b/tools/shadertoy/README.md index 283a65f..1ce42e8 100644 --- a/tools/shadertoy/README.md +++ b/tools/shadertoy/README.md @@ -44,8 +44,8 @@ EOF # Choose effect name (e.g., "tunnel", "plasma", "warp") EFFECT_NAME="myeffect" -cp tools/shadertoy/template.h src/gpu/effects/${EFFECT_NAME}_effect.h -cp tools/shadertoy/template.cc src/gpu/effects/${EFFECT_NAME}_effect.cc +cp tools/shadertoy/template.h src/effects/${EFFECT_NAME}_effect.h +cp tools/shadertoy/template.cc src/effects/${EFFECT_NAME}_effect.cc cp tools/shadertoy/template.wgsl workspaces/main/shaders/${EFFECT_NAME}.wgsl ``` @@ -94,7 +94,7 @@ shaders/myeffect.wgsl In `src/gpu/demo_effects.h`: ```cpp -#include "gpu/effects/myeffect_effect.h" +#include "effects/myeffect_effect.h" ``` In `workspaces/main/timeline.seq`: @@ -107,7 +107,7 @@ SEQUENCE 0.0 0 Add effect source to `CMakeLists.txt` GPU_SOURCES (both headless and normal mode sections): ```cmake -src/gpu/effects/myeffect_effect.cc +src/effects/myeffect_effect.cc ``` ### 8. Update Tests @@ -201,4 +201,4 @@ Always available in `uniforms: CommonUniforms`: - See `doc/CONTRIBUTING.md` for commit policy - See `doc/SEQUENCE.md` for timeline syntax -- See existing effects in `src/gpu/effects/` for examples +- See existing effects in `src/effects/` for examples diff --git a/tools/shadertoy/convert_shadertoy.py b/tools/shadertoy/convert_shadertoy.py index e85f384..ad4c310 100755 --- a/tools/shadertoy/convert_shadertoy.py +++ b/tools/shadertoy/convert_shadertoy.py @@ -10,8 +10,8 @@ # ./tools/shadertoy/convert_shadertoy.py tools/shadertoy/example.txt Rainbow # # Generates: -# - src/gpu/effects/<effect>_effect.h -# - src/gpu/effects/<effect>_effect.cc +# - src/effects/<effect>_effect.h +# - src/effects/<effect>_effect.cc # - workspaces/main/shaders/<effect>.wgsl # # The script performs basic ShaderToy→WGSL conversion: @@ -150,7 +150,7 @@ def generate_header(effect_name, is_post_process=False): #define {upper_name}_EFFECT_H_ #include "gpu/effect.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" class {class_name} : public PostProcessEffect {{ public: @@ -197,7 +197,7 @@ def generate_implementation(effect_name, is_post_process=False): // Generated by convert_shadertoy.py #include "gpu/demo_effects.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/gpu.h" {class_name}::{class_name}(const GpuContext& ctx) : PostProcessEffect(ctx) {{ @@ -309,8 +309,8 @@ def main(): print(" --shader-only Only regenerate .wgsl shader (skip .h/.cc files)") print() print("This will generate:") - print(" src/gpu/effects/<effect>_effect.h") - print(" src/gpu/effects/<effect>_effect.cc") + print(" src/effects/<effect>_effect.h") + print(" src/effects/<effect>_effect.cc") print(" workspaces/main/shaders/<effect>.wgsl") sys.exit(1) @@ -370,20 +370,20 @@ def main(): print(f" SHADER_{upper_name}, NONE, shaders/{snake_name}.wgsl, \"{effect_name} effect\"") print() print() - print("2. Add shader declaration to src/gpu/effects/shaders.h:") + print("2. Add shader declaration to src/gpu/shaders.h:") print(f" extern const char* {snake_name}_shader_wgsl;") print() - print("3. Add shader definition to src/gpu/effects/shaders.cc:") + print("3. Add shader definition to src/gpu/shaders.cc:") print(f" const char* {snake_name}_shader_wgsl = SafeGetAsset(AssetId::ASSET_SHADER_{upper_name});") print() print("4. Include header in src/gpu/demo_effects.h:") - print(f' #include "gpu/effects/{snake_name}_effect.h"') + print(f' #include "effects/{snake_name}_effect.h"') print() print("5. Add to timeline in workspaces/main/timeline.seq:") print(f" EFFECT + {effect_name}Effect 0.0 10.0") print() print("6. Add to CMakeLists.txt GPU_SOURCES (both headless and normal mode):") - print(f" src/gpu/effects/{snake_name}_effect.cc") + print(f" src/effects/{snake_name}_effect.cc") print() print("7. Update src/tests/gpu/test_demo_effects.cc:") test_list = "post_process_effects" if is_post_process else "scene_effects" diff --git a/tools/shadertoy/template.cc b/tools/shadertoy/template.cc index 288283d..35c9b10 100644 --- a/tools/shadertoy/template.cc +++ b/tools/shadertoy/template.cc @@ -2,8 +2,8 @@ // ShaderToy effect implementation - REPLACE THIS LINE // TODO: Update description, rename class -#include "gpu/effects/shadertoy_effect.h" -#include "gpu/effects/shader_composer.h" +#include "effects/shadertoy_effect.h" +#include "gpu/shader_composer.h" #include "generated/assets.h" // TODO: Rename class and adjust constructor parameters diff --git a/tools/shadertoy/template.h b/tools/shadertoy/template.h index 2e4af5f..82f8b39 100644 --- a/tools/shadertoy/template.h +++ b/tools/shadertoy/template.h @@ -6,7 +6,7 @@ #define SHADERTOY_EFFECT_H_ #include "gpu/effect.h" -#include "gpu/effects/post_process_helper.h" +#include "gpu/post_process_helper.h" #include "gpu/uniform_helper.h" // TODO: Rename class to match your effect (e.g., TunnelEffect, PlasmaEffect) |
