From 5ceb0256792053ee80841f2b5ac0dfae1fd4c6f8 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 11 Feb 2026 11:58:24 +0100 Subject: 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 --- test_passthrough.wgsl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test_passthrough.wgsl (limited to 'test_passthrough.wgsl') diff --git a/test_passthrough.wgsl b/test_passthrough.wgsl new file mode 100644 index 0000000..1e5f52a --- /dev/null +++ b/test_passthrough.wgsl @@ -0,0 +1,10 @@ +@vertex fn vs_main(@builtin(vertex_index) i: u32) -> @builtin(position) vec4 { + var pos = array, 3>( + vec2(-1.0, -1.0), vec2(3.0, -1.0), vec2(-1.0, 3.0) + ); + return vec4(pos[i], 0.0, 1.0); +} + +@fragment fn fs_main(@builtin(position) p: vec4) -> @location(0) vec4 { + return vec4(1.0, 0.0, 0.0, 1.0); // Solid red +} -- cgit v1.2.3