mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-12-18 03:25:28 +00:00
destroy subsequent command buffers if we encountered an error at submission
This gets the `wgpu_test::ray_tracing::as_build::out_of_order_as_build` test to pass. This seems to be an issue even on trunk, looking at the nr of calls to `create_command_encoder` & `destroy_command_encoder` in hal, they are not equal. So, I'm not sure why the validation layers don't raise the `VUID-vkDestroyDevice-device-05137`. There is still an issue with previous command buffers being leaked but I will fix this in a follow-up.
This commit is contained in:
parent
5a3de2d3a8
commit
278620be26
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user