You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If you create 2 command encoders and create a render pass in each referring to a surface (possibly can even be different surfaces but I haven't checked), then submit the resulting command buffers together, the program crashes
Repro steps
Make the following change to the cube example
diff --git a/wgpu/examples/cube/main.rs b/wgpu/examples/cube/main.rs
index dadf81b0..00f4b144 100644
--- a/wgpu/examples/cube/main.rs+++ b/wgpu/examples/cube/main.rs@@ -392,8 +392,24 @@ impl framework::Example for Example {
rpass.draw_indexed(0..self.index_count as u32, 0, 0..1);
}
}
-- queue.submit(Some(encoder.finish()));+ let mut encoder2 =+ device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });+ {+ let mut rpass = encoder2.begin_render_pass(&wgpu::RenderPassDescriptor {+ label: None,+ color_attachments: &[Some(wgpu::RenderPassColorAttachment {+ view,+ resolve_target: None,+ ops: wgpu::Operations {+ load: wgpu::LoadOp::Load,+ store: true,+ },+ })],+ depth_stencil_attachment: None,+ });+ }++ queue.submit([encoder.finish(), encoder2.finish()]);
// If an error occurs, report it and panic.
spawner.spawn_local(ErrorFuture {
Run the example (with RUST_BACKTRACE=1)
thread 'main' panicked at 'assertion failed: index < self.owned.len()', <removed>/wgpu/wgpu-core/src/track/mod.rs:355:9
stack backtrace:
0: rust_begin_unwind
at /rustc/f2d93935ffba3ab9d7ccb5300771a2d29b4c8bf3/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/f2d93935ffba3ab9d7ccb5300771a2d29b4c8bf3/library/core/src/panicking.rs:142:14
2: core::panicking::panic
at /rustc/f2d93935ffba3ab9d7ccb5300771a2d29b4c8bf3/library/core/src/panicking.rs:48:5
3: wgpu_core::track::ResourceMetadata<A>::debug_assert_in_bounds
at <removed>/wgpu/wgpu-core/src/track/mod.rs:355:9
4: wgpu_core::track::texture::TextureUsageScope<A>::debug_assert_in_bounds
at <removed>/wgpu/wgpu-core/src/track/texture.rs:237:9
5: wgpu_core::track::texture::TextureUsageScope<A>::merge_single
at <removed>/wgpu/wgpu-core/src/track/texture.rs:360:9
6: wgpu_core::device::queue::<impl wgpu_core::hub::Global<G>>::queue_submit
at <removed>/wgpu/wgpu-core/src/device/queue.rs:850:37
7: <wgpu::backend::direct::Context as wgpu::Context>::queue_submit
at ./src/backend/direct.rs:2291:15
8: wgpu::Queue::submit
at ./src/lib.rs:3497:19
9: <cube::Example as cube::framework::Example>::render
at ./examples/cube/main.rs:412:9
10: cube::framework::start::{{closure}}
at ./examples/cube/../framework.rs:375:17
(end of the backtrace removed because it's not particularly relevant)
Extra materials
Probably due to this line replacing used_surface_textures without ensuring it has enough capacity?
Description
If you create 2 command encoders and create a render pass in each referring to a surface (possibly can even be different surfaces but I haven't checked), then submit the resulting command buffers together, the program crashes
Repro steps
Make the following change to the cube example
Run the example (with RUST_BACKTRACE=1)
Extra materials
Probably due to this line replacing
used_surface_textures
without ensuring it has enough capacity?wgpu/wgpu-core/src/device/queue.rs
Line 964 in 72a4ef9
Platform
Linux with wayland (sway)
AMD Radeon RX 6700 XT (Vulkan)
The text was updated successfully, but these errors were encountered: