mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
fix: discard cmd. enc. buf. on wgpu_core::Global::command_encoder_drop
This commit is contained in:
parent
be8c7e6ced
commit
d189cf27e8
@ -61,6 +61,14 @@ Bottom level categories:
|
||||
- `tan`
|
||||
- `tanh`
|
||||
|
||||
## v0.19.3 (2024-03-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
#### General
|
||||
|
||||
- Fix an issue where command encoders weren't properly freed if an error occurred during command encoding. By @ErichDonGubler in [#5251](https://github.com/gfx-rs/wgpu/pull/5251).
|
||||
|
||||
## v0.19.2 (2024-02-29)
|
||||
|
||||
### Added/New Features
|
||||
|
@ -78,7 +78,7 @@ impl<A: HalApi> CommandEncoder<A> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn discard(&mut self) {
|
||||
pub(crate) fn discard(&mut self) {
|
||||
if self.is_open {
|
||||
self.is_open = false;
|
||||
unsafe { self.raw.discard_encoding() };
|
||||
@ -115,7 +115,7 @@ pub(crate) struct DestroyedBufferError(pub id::BufferId);
|
||||
pub(crate) struct DestroyedTextureError(pub id::TextureId);
|
||||
|
||||
pub struct CommandBufferMutable<A: HalApi> {
|
||||
encoder: CommandEncoder<A>,
|
||||
pub(crate) encoder: CommandEncoder<A>,
|
||||
status: CommandEncoderStatus,
|
||||
pub(crate) trackers: Tracker<A>,
|
||||
buffer_memory_init_actions: Vec<BufferInitTrackerAction<A>>,
|
||||
|
@ -1354,6 +1354,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let hub = A::hub(self);
|
||||
|
||||
if let Some(cmd_buf) = hub.command_buffers.unregister(command_encoder_id) {
|
||||
cmd_buf.data.lock().as_mut().unwrap().encoder.discard();
|
||||
|
||||
cmd_buf
|
||||
.device
|
||||
.untrack(&cmd_buf.data.lock().as_ref().unwrap().trackers);
|
||||
|
Loading…
Reference in New Issue
Block a user