diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-11 12:01:20 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-11 12:01:20 +0100 |
| commit | f21d120b27e736eed42a5506ea1f3a879c150af5 (patch) | |
| tree | f22aaccda2f5066f78b4e7d5c04200852e70c017 /doc | |
| parent | 3159f625ece457fd0859939f61485090d5d99693 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/AUXILIARY_TEXTURE_INIT.md | 22 |
1 files changed, 22 insertions, 0 deletions
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 |
