diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index fe53fb6521..370880a931 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -1209,6 +1209,13 @@ impl Queue { } } + if first_error.is_some() { + if let Ok(cmd_buf_data) = cmd_buf_data { + cmd_buf_data.destroy(&command_buffer.device); + } + continue; + } + let mut baked = match cmd_buf_data { Ok(cmd_buf_data) => { let res = validate_command_buffer( @@ -1232,10 +1239,6 @@ impl Queue { } }; - if first_error.is_some() { - continue; - } - // execute resource transitions if let Err(e) = unsafe { baked.encoder.begin_encoding(hal_label(