rend3: Subscript out of range in get_material_key
Upgraded to Rend3 0.5.0. Crash on first test. The display comes up, and some objects are drawn, but after about 1s there is a crash.
./slscenetester --dumpfile …/…/…/testdata/boardroom.json
Logging to “/tmp/log.txt”
03:41:26 [WARN] No config found!
03:41:26 [WARN] EGL says it can present to the window but not natively. This has been confirmed to malfunction on Intel+NV laptops. Therefore, we disable presentation entirely for this platform
03:41:26 [WARN] Surface does not support present mode: Mailbox, falling back to FIFO
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unknown decoration Restrict
03:41:26 [WARN] Unexpected varying type: Array { base: [4], size: Constant([8]), stride: 4 }
03:41:26 [WARN] Unexpected varying type: Array { base: [4], size: Constant([5]), stride: 4 }
Reading gltf file: /home/john/projects/sl/SL-test-viewer/slscenetester/data/unitcube2.gltf
03:41:26 [WARN] Surface does not support present mode: Mailbox, falling back to FIFO
Region offset for “Boardroom”: [0, 0, 0]
Add built-in object at Vec3(128.0, 21.0, 128.0) size Vec3(256.0, 1.0, 256.0)
thread ‘main’ panicked at ‘index out of bounds: the len is 212 but the index is 212’, /home/john/.cargo/registry/src/github.com-1ecc6299db9ec823/rend3-0.2.0/src/resources/material.rs:422:15
stack backtrace:
0: rust_begin_unwind
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
1: core::panicking::panic_fmt
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
2: core::panicking::panic_bounds_check
at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:69:5
3: rend3::resources::material::get_material_key
4: rend3::resources::object::ObjectManager::fill
5: rend3::renderer::render::render_loop
6: slscenetester::displaystate::{{closure}}
7: winit::platform_impl::platform::x11::EventLoop<T>::run
8: winit::platform_impl::platform::EventLoop<T>::run
9: winit::event_loop::EventLoop<T>::run
10: slscenetester::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
john@user-desktop:~/projects/sl/SL-test-viewer/slscenetester/target/release$
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (18 by maintainers)
More info: it looks like there are cases where I create a material and then discover I don’t need it because the associated mesh is not present. So the material is created and immediately dropped without ever being used. Could that be causing trouble?