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

add test that verifies that we can drop the queue before using the device to create a command encoder #5211

Merged

Conversation

Davidster
Copy link
Contributor

@Davidster Davidster commented Feb 6, 2024

I guess the issue would actually need to be fixed before this test gets merged?

Connections
n/a

Description
I noticed some code in the wgpu-profiler tests where the queue is dropped before we call Device::create_command_encoder. It produces the following panic:

thread 'src::errors::end_frame_unresolved_query' panicked at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\storage.rs:113:39:
Queue[Id(0,1,vk)] does not exist
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:72
   2: wgpu_core::storage::Storage<wgpu_core::device::queue::Queue<wgpu_hal::vulkan::Api>,wgpu_core::id::Id<wgpu_core::device::resource::Device<wgpu_hal::empty::Api> > >::get<wgpu_core::device::queue::Queue<wgpu_hal::vulkan::Api>,wgpu_core::id::Id<wgpu_core::dev
             at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\storage.rs:113
   3: wgpu_core::storage::Storage<wgpu_core::device::queue::Queue<wgpu_hal::vulkan::Api>,wgpu_core::id::Id<wgpu_core::device::resource::Device<wgpu_hal::empty::Api> > >::get_owned<wgpu_core::device::queue::Queue<wgpu_hal::vulkan::Api>,wgpu_core::id::Id<wgpu_cor
             at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\storage.rs:128
   4: wgpu_core::registry::Registry<wgpu_core::id::Id<wgpu_core::device::resource::Device<wgpu_hal::empty::Api> >,wgpu_core::device::queue::Queue<wgpu_hal::vulkan::Api> >::get<wgpu_core::id::Id<wgpu_core::device::resource::Device<wgpu_hal::empty::Api> >,wgpu_co
             at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\registry.rs:136
   5: wgpu_core::global::Global<wgpu_core::identity::IdentityManagerFactory>::device_create_command_encoder<wgpu_core::identity::IdentityManagerFactory,wgpu_hal::vulkan::Api>
             at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\device\global.rs:1313
   6: wgpu::backend::wgpu_core::impl$7::device_create_command_encoder
             at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\backend\wgpu_core.rs:1331
   7: wgpu::context::impl$5::device_create_command_encoder<wgpu::backend::wgpu_core::ContextWgpuCore>
             at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\context.rs:2336
   8: wgpu::Device::create_command_encoder
             at C:\Users\s\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\lib.rs:2395
   9: tests::src::errors::end_frame_unresolved_query
             at .\tests\src\errors.rs:51
  10: tests::src::errors::end_frame_unresolved_query::closure$0
             at .\tests\src\errors.rs:46
  11: core::ops::function::FnOnce::call_once<tests::src::errors::end_frame_unresolved_query::closure_env$0,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\ops\function.rs:250
  12: core::ops::function::FnOnce::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This test reproduces this panic.

Testing
Run cargo xtask test

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Davidster Davidster requested a review from a team as a code owner February 6, 2024 18:14
tests/tests/encoder.rs Outdated Show resolved Hide resolved
@nical nical merged commit 245d2da into gfx-rs:trunk Feb 9, 2024
27 checks passed
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

Successfully merging this pull request may close these issues.

3 participants