diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-04 11:56:03 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-04 11:56:03 +0100 |
| commit | 2e34965e5e48175c5ee6016af1a858f7f3f02c1d (patch) | |
| tree | a41ea2fdc50a18183742bffaf0705b394f2be69f /TODO.md | |
| parent | 0d29f340b9de8f6a14baa0a2c6f3c57b8d1458a5 (diff) | |
feat(gpu): Implement recursive WGSL composition and modularize shaders (Task #50)
- Updated ShaderComposer to support recursive #include "snippet_name" with cycle detection.
- Extracted granular WGSL snippets: math/sdf_shapes, math/sdf_utils, render/shadows, render/scene_query, render/lighting_utils.
- Refactored Renderer3D to use #include in shaders, simplifying C++ dependency lists.
- Fixed WGPUShaderSourceWGSL usage on macOS to correctly handle composed shader strings.
- Added comprehensive unit tests for recursive composition in test_shader_composer.
- Verified system stability with test_3d_render and full test suite.
- Marked Task #50 as recurrent for future code hygiene.
Diffstat (limited to 'TODO.md')
| -rw-r--r-- | TODO.md | 27 |
1 files changed, 8 insertions, 19 deletions
@@ -3,6 +3,12 @@ This file tracks prioritized tasks with detailed attack plans. ## Recently Completed (February 4, 2026) +- [x] **Task #50: WGSL Modularization**: + - [x] **Recursive Composition**: Updated `ShaderComposer` to support recursive `#include "snippet_name"` directives with cycle detection. + - [x] **Granular SDF Library**: Extracted `math/sdf_shapes.wgsl`, `math/sdf_utils.wgsl`, `render/shadows.wgsl`, `render/scene_query.wgsl`, and `render/lighting_utils.wgsl`. + - [x] **Pipeline Update**: Refactored `Renderer3D` and `renderer_3d.wgsl` to use the new modular system, reducing C++-side dependency management. + - [x] **Platform Fix**: Resolved `WGPUShaderSourceWGSL` usage on macOS to ensure compatibility with composed shader strings. + - [x] **Task #48: Improve Audio Coverage**: - [x] **New Tests**: Added `test_dct` (100% coverage for transforms) and `test_audio_gen` (94% coverage for procedural audio). - [x] **Enhanced Tests**: Updated `test_synth` to cover rendering loop, double-buffering, and resource exhaustion. @@ -30,25 +36,8 @@ This file tracks prioritized tasks with detailed attack plans. - [ ] **Task #37: Asset Ingestion:** Update `asset_packer` to handle the new 3D binary format. - [ ] **Task #38: Runtime Loader:** Implement a minimal C++ parser to load the scene data into the ECS/Renderer. -## Priority 2: WGSL Modularization (Task #50) -**Goal**: Refactor `ShaderComposer` and WGSL assets to support granular, reusable snippets and `#include` directives. - -- [ ] **Task #50.1: Recursive Composition Support**: - - [ ] Update `ShaderComposer::Compose` to parse `#include "snippet_name"` directives in shader code. - - [ ] Implement recursive resolution (with cycle detection) to assemble the final shader. - - [ ] Update `test_shader_composer.cc` to verify recursive includes. - -- [ ] **Task #50.2: Granular SDF Library**: - - [ ] Extract `sdSphere`, `sdBox`, `sdTorus`, `sdPlane` from `sdf_primitives.wgsl` into `math/sdf_shapes.wgsl`. - - [ ] Extract `get_normal_basic` into `math/sdf_utils.wgsl`. - - [ ] Extract `calc_shadow` into `render/shadows.wgsl`. - -- [ ] **Task #50.3: Scene & Material Refactor**: - - [ ] Extract `map_scene` and `get_dist` logic into `render/scene_query.wgsl`. - - [ ] Extract lighting and material logic from `fs_main` into `render/lighting_pbr.wgsl` (or similar). - -- [ ] **Task #50.4: Pipeline Update**: - - [ ] Update `Renderer3D` to use the new granular assets via `#include` in the main shader, reducing C++-side dependency lists. +## Priority 2: WGSL Modularization (Task #50) [RECURRENT] +**Goal**: Refactor `ShaderComposer` and WGSL assets to support granular, reusable snippets and `#include` directives. This is an ongoing task to maintain shader code hygiene as new features are added. ## Priority 3: Physics & Collision (Task #49) **Goal**: Implement a lightweight physics engine using SDFs and BVH acceleration. (See `doc/3D.md` for design). |
