Avoid leaking submitted command encoders (#5141)

* Avoid leaking submitted command encoders

* changelog
This commit is contained in:
Nicolas Silva
2024-06-24 14:16:55 +02:00
committed by GitHub
parent 355613342e
commit ddff69ba21
2 changed files with 9 additions and 1 deletions

View File

@@ -154,6 +154,7 @@ By @atlv24 in [#5383](https://github.com/gfx-rs/wgpu/pull/5383)
- Ensure render pipelines have at least 1 target. By @ErichDonGubler in [#5715](https://github.com/gfx-rs/wgpu/pull/5715)
- `wgpu::ComputePass` now internally takes ownership of `QuerySet` for both `wgpu::ComputePassTimestampWrites` as well as timestamp writes and statistics query, fixing crashes when destroying `QuerySet` before ending the pass. By @wumpf in [#5671](https://github.com/gfx-rs/wgpu/pull/5671)
- Validate resources passed during compute pass recording for mismatching device. By @wumpf in [#5779](https://github.com/gfx-rs/wgpu/pull/5779)
- Fix a `CommandBuffer` leak. By @cwfitzgerald and @nical in [#5141](https://github.com/gfx-rs/wgpu/pull/5141)
#### DX12

View File

@@ -2326,10 +2326,17 @@ impl crate::Context for ContextWgpuCore {
.map(|(i, _)| i)
.collect::<SmallVec<[_; 4]>>();
match wgc::gfx_select!(*queue => self.0.queue_submit(*queue, &temp_command_buffers)) {
let index = match wgc::gfx_select!(*queue => self.0.queue_submit(*queue, &temp_command_buffers))
{
Ok(index) => index,
Err(err) => self.handle_error_fatal(err, "Queue::submit"),
};
for cmdbuf in &temp_command_buffers {
wgc::gfx_select!(*queue => self.0.command_buffer_drop(*cmdbuf));
}
index
}
fn queue_get_timestamp_period(