Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option::unwrap() failed in rend3::managers:material::apply_buffer_cpu() #564

Open
kpreid opened this issue Jan 8, 2024 · 0 comments
Open

Comments

@kpreid
Copy link
Contributor

kpreid commented Jan 8, 2024

I haven't got a self-contained repro yet, but it involves loading an empty glTF scene with unused materials.

Backtrace:

   3: core::option::Option<T>::unwrap
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:931:21
   4: rend3::managers::material::apply_buffer_cpu::{{closure}}
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/managers/material.rs:319:48
   5: rend3::util::freelist::buffer::FreelistDerivedBuffer::apply::{{closure}}
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/util/freelist/buffer.rs:94:24
   6: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:305:13
   7: core::option::Option<T>::map
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:1072:29
   8: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/adapters/map.rs:103:26
   9: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::next
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/adapters/enumerate.rs:47:17
  10: rend3::util::scatter_copy::ScatterCopy::execute_copy
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/util/scatter_copy.rs:108:28
  11: rend3::util::freelist::buffer::FreelistDerivedBuffer::apply
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/util/freelist/buffer.rs:101:9
  12: rend3::managers::material::apply_buffer_cpu
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/managers/material.rs:318:5
  13: rend3::managers::material::MaterialManager::evaluate
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/managers/material.rs:230:21
  14: rend3::renderer::eval::evaluate_instructions
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/renderer/eval.rs:186:5
  15: rend3::renderer::Renderer::evaluate_instructions
             at /Users/kpreid/.cargo/git/checkouts/rend3-e03f89403de3386a/a68c76a/rend3/src/renderer/mod.rs:482:9
  16: gltf_render::GltfRend3Renderer::render_to_rend3
             at ./tests/gltf-render.rs:167:31

Code:

let material = &data_vec[idx].as_ref().unwrap().inner;

rend3 version: a68c76a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant