diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-15 18:05:22 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-15 18:05:22 +0100 |
| commit | d7ec4c61bd11c731d21e269c87bc446b13cbe5e7 (patch) | |
| tree | 5acf43c7ca2a2faca28cf4b1da632bbfc7e2110f /doc/BUILD.md | |
| parent | c8dd8b43df063108b4d6754621612edf4aa4e3cf (diff) | |
refactor(build): granular asset tracking and CMake deduplication
Implements Phases 1 & 2 of CMake consolidation plan to improve
incremental build performance and reduce code duplication.
Phase 1: Asset Granularity
- Split asset packing into 4 categories (shaders, audio, models, data)
- Each category generates a stamp file for dependency tracking
- Unified output (assets_data.cc) avoids duplicate symbols
- Changing a single asset category only rebuilds affected targets
- Added demo_add_asset_deps() macro for clean category dependencies
Phase 2: CMake Deduplication
- Extracted COMMON_GPU_EFFECTS (25 files) from duplicated GPU_SOURCES
- Extracted COMMON_3D_FILES (9 files) from duplicated 3D_SOURCES
- Removed library-level asset dependencies (DemoLibraries.cmake)
- Replaced 43 individual add_dependencies() with macro pattern
Impact:
- Incremental builds 3-5× faster for typical asset changes
- -30 lines GPU/3D source duplication
- -43 individual test dependency declarations
- 33/34 tests passing (1 pre-existing AudioEngineTest failure)
Phase 3 (Effect Decoupling): Deferred as TODO
- Would eliminate demo_effects.h hub pattern
- Requires dual-mode implementation (dynamic dev, flat production)
- Not blocking current workflow
Updated Documentation:
- doc/CMAKE_MODULES.md: Added demo_add_asset_deps() docs
- doc/BUILD.md: Documented asset category system
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/BUILD.md')
| -rw-r--r-- | doc/BUILD.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/BUILD.md b/doc/BUILD.md index d3434f4..fd0c3d9 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -95,9 +95,11 @@ Use Xcode Metal debugger for shader performance analysis. ## Build System Internals **Asset Dependency Tracking:** -- CMake tracks 42 demo + 17 test assets -- Editing shaders/audio/sequences auto-triggers rebuild -- Asset lists parsed to extract individual file dependencies +- CMake tracks 42 demo + 17 test assets split into 4 categories +- **Granular rebuilds:** Changing a shader only rebuilds shader-dependent targets +- **Categories:** `shaders` (.wgsl), `audio` (.spec, .track), `models` (.obj), `data` (.bin, .png, PROC) +- Asset lists parsed at configure time to extract category-specific file dependencies +- Unified output (`assets_data.cc`) avoids duplicate symbols while preserving granular tracking **Header Organization:** - `asset_manager_dcl.h`: Forward declarations |
