From fb2aa8b608cb423b8b9f140b359b5a0dddbcb43c Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 7 Feb 2026 17:22:03 +0100 Subject: fix: Auto-regenerate assets after clean build - Added GENERATED property to all generated files - Added explicit dependencies: audio/3d/gpu libraries depend on generate_demo_assets - Updated seq_compiler to use GpuContext instead of device/queue/format - Removed stale test asset files from src/generated (now in build/src/generated_test) Fixes 'fatal error: generated/assets.h file not found' after make clean. All 28 tests pass. --- HANDOFF_2026-02-07_GpuContext.md | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 HANDOFF_2026-02-07_GpuContext.md (limited to 'HANDOFF_2026-02-07_GpuContext.md') diff --git a/HANDOFF_2026-02-07_GpuContext.md b/HANDOFF_2026-02-07_GpuContext.md new file mode 100644 index 0000000..bff2932 --- /dev/null +++ b/HANDOFF_2026-02-07_GpuContext.md @@ -0,0 +1,83 @@ +# Handoff: GpuContext Refactor (February 7, 2026) + +## Session Summary +Completed two-phase refactor to improve GPU context management in Effect system. + +## Commits Made + +### Commit 1: bd939ac +**Title:** `refactor: Bundle GPU context into GpuContext struct` + +**Changes:** +- Created `GpuContext` struct bundling device/queue/format +- Updated Effect/PostProcessEffect constructors to take `const GpuContext&` +- Updated all 19 effect implementations +- Updated MainSequence.init() and LoadTimeline() signatures +- Added `gpu_get_context()` accessor +- Fixed test_mesh.cc compilation error (g_device/g_queue/g_format conflicts) + +**Files:** 35 changed, 470 insertions(+), 248 deletions(-) + +### Commit 2: 8c9815a +**Title:** `refactor: Store const GpuContext& in Effect base class` + +**Rationale:** User suggested storing `const GpuContext& ctx_` instead of splitting into individual members. + +**Changes:** +- Effect now stores `const GpuContext& ctx_` instead of `device_`, `queue_`, `format_` +- Simplified constructor: `ctx_(ctx)` vs `device_(ctx.device), queue_(ctx.queue), format_(ctx.format)` +- Updated all effects to use `ctx_.device`, `ctx_.queue`, `ctx_.format` + +**Lifetime Safety:** Reference points to static global `g_gpu_context` from `gpu_get_context()`, which outlives all effects. + +**Files:** 16 changed, 58 insertions(+), 60 deletions(-) + +## Build Status +- ✅ All targets build successfully (demo64k, test_demo, all tests) +- ✅ All 28 tests pass (100% success rate) +- ✅ Working tree clean +- ✅ 3 commits ahead of origin/main + +## Technical Notes + +**GpuContext Lifetime:** +```cpp +// Safe reference chain: +static GpuContext g_gpu_context = {}; // Static global +gpu_get_context() → &g_gpu_context // Returns pointer to static +*gpu_ctx // Dereference +LoadTimeline(..., *gpu_ctx) // Pass by reference +Effect::ctx_ // Store reference to static +``` + +**Effect Access Pattern:** +```cpp +class Effect { + protected: + const GpuContext& ctx_; + // Effects access: ctx_.device, ctx_.queue, ctx_.format +}; +``` + +## Files Modified (Total: 51 files across both commits) + +**Core:** +- src/gpu/gpu.{h,cc} +- src/gpu/effect.{h,cc} +- src/gpu/demo_effects.h + +**Effects (19 files):** +- All effects in src/gpu/effects/*.cc + +**Generated:** +- src/generated/timeline.cc +- src/generated/test_demo_timeline.cc + +**Tests (all test files updated to use fixture.ctx())** + +## Ready For +- Push to origin (`git push`) +- Continue with Task #5 (Spectral Brush Editor) or other priorities + +--- +**handoff(Claude):** GpuContext refactor complete. Effect base class now stores const GpuContext& reference. All 28 tests pass. -- cgit v1.2.3