-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Description
The Metal backend enforces a limit of 2048 pending command buffers here:
wgpu/wgpu-hal/src/metal/adapter.rs
Line 8 in 6451d31
| const MAX_COMMAND_BUFFERS: u64 = 2048; |
I am creating mipmaps for a very large (> 200 layers) texture array. My code is basically equivalent to this loop in the mipmap example (except I have to fill m x n mipmaps for m mipmap levels and n array layers):
wgpu/wgpu/examples/mipmap/main.rs
Line 136 in 6451d31
| for target_mip in 1..mip_count as usize { |
Apparently, the loop hits the limit of 2048 command buffers. My code deadlocks when trying to drop the current render pass inside the loop.
Repro steps
Just reduce MAX_COMMAND_BUFFERS to something like 10 and try the mipmap example, this has the same effect.
Expected vs observed behavior
The root problem seems to be the fact that each render pass starts a new command buffer. Maybe multiple render passes can be batched into one? Or maybe wgpu can at least notify me when the limit is reached by making begin_render_pass() fallible?
Platform
wgpu 0.14, metal backend on macOS / iOS
Metadata
Metadata
Assignees
Labels
Type
Projects
Status