mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
move body of BufferUsageScope.insert_merge_single
in BufferUsageScope.merge_single
This commit is contained in:
parent
aaec1c37b9
commit
26eceabe86
@ -781,7 +781,7 @@ impl Global {
|
|||||||
state
|
state
|
||||||
.scope
|
.scope
|
||||||
.buffers
|
.buffers
|
||||||
.insert_merge_single(buffer.clone(), hal::BufferUses::INDIRECT)
|
.merge_single(&buffer, hal::BufferUses::INDIRECT)
|
||||||
.map_pass_err(scope)?;
|
.map_pass_err(scope)?;
|
||||||
buffer
|
buffer
|
||||||
.check_usage(wgt::BufferUsages::INDIRECT)
|
.check_usage(wgt::BufferUsages::INDIRECT)
|
||||||
|
@ -229,21 +229,6 @@ impl<A: HalApi> BufferUsageScope<A> {
|
|||||||
&mut self,
|
&mut self,
|
||||||
buffer: &Arc<Buffer<A>>,
|
buffer: &Arc<Buffer<A>>,
|
||||||
new_state: BufferUses,
|
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<Buffer<A>>,
|
|
||||||
new_state: BufferUses,
|
|
||||||
) -> Result<(), UsageConflict> {
|
) -> Result<(), UsageConflict> {
|
||||||
let index = buffer.info.tracker_index().as_usize();
|
let index = buffer.info.tracker_index().as_usize();
|
||||||
|
|
||||||
@ -260,7 +245,7 @@ impl<A: HalApi> BufferUsageScope<A> {
|
|||||||
index,
|
index,
|
||||||
BufferStateProvider::Direct { state: new_state },
|
BufferStateProvider::Direct { state: new_state },
|
||||||
ResourceMetadataProvider::Direct {
|
ResourceMetadataProvider::Direct {
|
||||||
resource: Cow::Owned(buffer),
|
resource: Cow::Owned(buffer.clone()),
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user