diff --git a/wgpu-core/src/command/memory_init.rs b/wgpu-core/src/command/memory_init.rs index 99f6c40cf..129a069f7 100644 --- a/wgpu-core/src/command/memory_init.rs +++ b/wgpu-core/src/command/memory_init.rs @@ -208,7 +208,7 @@ impl BakedCommands { } } - for (buffer_id, (buffer, mut ranges)) in uninitialized_ranges_per_buffer { + for (buffer, mut ranges) in uninitialized_ranges_per_buffer.into_values() { // Collapse touching ranges. ranges.sort_by_key(|r| r.start); for i in (1..ranges.len()).rev() { @@ -234,7 +234,7 @@ impl BakedCommands { let raw_buf = buffer .raw .get(snatch_guard) - .ok_or(DestroyedBufferError(buffer_id))?; + .ok_or(DestroyedBufferError(buffer.error_ident()))?; unsafe { self.encoder.transition_buffers( diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 8d181a55b..1481023b7 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -243,7 +243,7 @@ pub(crate) struct BakedCommands { texture_memory_actions: CommandBufferTextureMemoryActions, } -pub(crate) struct DestroyedBufferError(pub id::BufferId); +pub(crate) struct DestroyedBufferError(pub ResourceErrorIdent); pub(crate) struct DestroyedTextureError(pub ResourceErrorIdent); /// The mutable state of a [`CommandBuffer`]. diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index e76876394..f7706453d 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -372,8 +372,8 @@ pub enum QueueWriteError { pub enum QueueSubmitError { #[error(transparent)] Queue(#[from] DeviceError), - #[error("Buffer {0:?} is destroyed")] - DestroyedBuffer(id::BufferId), + #[error("{0} has been destroyed")] + DestroyedBuffer(ResourceErrorIdent), #[error("{0} has been destroyed")] DestroyedTexture(ResourceErrorIdent), #[error(transparent)] @@ -1222,7 +1222,7 @@ impl Global { for buffer in cmd_buf_trackers.buffers.used_resources() { if buffer.raw.get(&snatch_guard).is_none() { return Err(QueueSubmitError::DestroyedBuffer( - buffer.info.id(), + buffer.error_ident(), )); } buffer.info.use_at(submit_index);