diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 33a95ac1a8..4be9102d28 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -781,7 +781,7 @@ impl Global { state .scope .buffers - .insert_merge_single(buffer.clone(), hal::BufferUses::INDIRECT) + .merge_single(&buffer, hal::BufferUses::INDIRECT) .map_pass_err(scope)?; buffer .check_usage(wgt::BufferUsages::INDIRECT) diff --git a/wgpu-core/src/track/buffer.rs b/wgpu-core/src/track/buffer.rs index 8813c23a0d..ce972a16fb 100644 --- a/wgpu-core/src/track/buffer.rs +++ b/wgpu-core/src/track/buffer.rs @@ -229,21 +229,6 @@ impl BufferUsageScope { &mut self, buffer: &Arc>, new_state: BufferUses, - ) -> Result<(), UsageConflict> { - self.insert_merge_single(buffer.clone(), new_state) - } - - /// Merge a single state into the UsageScope, using an already resolved buffer. - /// - /// If the resulting state is invalid, returns a usage - /// conflict with the details of the invalid state. - /// - /// If the ID is higher than the length of internal vectors, - /// the vectors will be extended. A call to set_size is not needed. - pub fn insert_merge_single( - &mut self, - buffer: Arc>, - new_state: BufferUses, ) -> Result<(), UsageConflict> { let index = buffer.info.tracker_index().as_usize(); @@ -260,7 +245,7 @@ impl BufferUsageScope { index, BufferStateProvider::Direct { state: new_state }, ResourceMetadataProvider::Direct { - resource: Cow::Owned(buffer), + resource: Cow::Owned(buffer.clone()), }, )?; }