From f21d120b27e736eed42a5506ea1f3a879c150af5 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 11 Feb 2026 12:01:20 +0100 Subject: docs: Update tech doc with Renderer3D initialization fix Document the additional fix required for effects with Renderer3D members. Explains why initialized_ flag is needed instead of ctx_.device check. Co-Authored-By: Claude Sonnet 4.5 --- doc/AUXILIARY_TEXTURE_INIT.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/AUXILIARY_TEXTURE_INIT.md b/doc/AUXILIARY_TEXTURE_INIT.md index e4200d1..d78c5ae 100644 --- a/doc/AUXILIARY_TEXTURE_INIT.md +++ b/doc/AUXILIARY_TEXTURE_INIT.md @@ -153,6 +153,28 @@ All 36 tests pass. Verified: - No artifacts or half-resolution bugs - Window resize works correctly +## Additional Fix Required + +After swapping init/resize order, effects with Renderer3D (FlashCubeEffect, Hybrid3DEffect) crashed when resize() tried to use uninitialized renderer. + +**Solution:** Add `initialized_` flag to track if init() was called. + +```cpp +// In header +bool initialized_ = false; + +// In init() +renderer_.init(ctx_.device, ctx_.queue, ctx_.format); +renderer_.resize(width_, height_); +initialized_ = true; // Mark as initialized + +// In resize() +if (!initialized_) + return; // Early exit if not initialized yet +``` + +**Why not check `ctx_.device`?** Device exists before init() (passed to constructor), but Renderer3D not initialized yet. + ## Related Documentation - `doc/MASKING_SYSTEM.md` - Auxiliary texture usage patterns -- cgit v1.2.3