diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-11 11:58:24 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-11 11:58:24 +0100 |
| commit | 5ceb0256792053ee80841f2b5ac0dfae1fd4c6f8 (patch) | |
| tree | e24dafeca0d270437a39c8d91c7f5c037cf0d2f4 /src/gpu/effects/hybrid_3d_effect.cc | |
| parent | 58c595810d0346f0c2b32dbc70b7385aee545e11 (diff) | |
fix: Complete auxiliary texture initialization fix
Root cause: After swapping init/resize order, effects with Renderer3D crashed
because resize() called before init() tried to use uninitialized GPU resources.
Changes:
- Add guards in FlashCubeEffect::resize() and Hybrid3DEffect::resize() to
check ctx_.device before calling renderer_.resize()
- Remove lazy initialization remnants from CircleMaskEffect and CNNEffect
- Register auxiliary textures directly in init() (width_/height_ already set)
- Remove ensure_texture() methods and texture_initialized_ flags
All 36 tests passing. Demo runs without crashes.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/gpu/effects/hybrid_3d_effect.cc')
| -rw-r--r-- | src/gpu/effects/hybrid_3d_effect.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gpu/effects/hybrid_3d_effect.cc b/src/gpu/effects/hybrid_3d_effect.cc index d580471..61b3734 100644 --- a/src/gpu/effects/hybrid_3d_effect.cc +++ b/src/gpu/effects/hybrid_3d_effect.cc @@ -12,8 +12,14 @@ Hybrid3DEffect::Hybrid3DEffect(const GpuContext& ctx) : Effect(ctx) { } void Hybrid3DEffect::resize(int width, int height) { - width_ = width; - height_ = height; + if (width == width_ && height == height_) + return; + + Effect::resize(width, height); + + if (!ctx_.device) + return; + renderer_.resize(width_, height_); } |
