mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
rename {Buffer,Texture}BindGroupState
's add_single
to insert_single
Also change it's definition to take an owned `Arc`. This makes these functions consistent with the other trackers.
This commit is contained in:
parent
826e3716e5
commit
62af9d78b5
@ -1917,7 +1917,7 @@ impl<A: HalApi> Device<A> {
|
||||
|
||||
let buffer = &bb.buffer;
|
||||
|
||||
used.buffers.add_single(buffer, internal_use);
|
||||
used.buffers.insert_single(buffer.clone(), internal_use);
|
||||
|
||||
buffer.same_device(self)?;
|
||||
|
||||
@ -2068,7 +2068,7 @@ impl<A: HalApi> Device<A> {
|
||||
// Careful here: the texture may no longer have its own ref count,
|
||||
// if it was deleted by the user.
|
||||
used.textures
|
||||
.add_single(texture, Some(view.selector.clone()), internal_use);
|
||||
.insert_single(texture.clone(), Some(view.selector.clone()), internal_use);
|
||||
|
||||
texture.check_usage(pub_usage)?;
|
||||
|
||||
|
@ -68,8 +68,8 @@ impl<A: HalApi> BufferBindGroupState<A> {
|
||||
}
|
||||
|
||||
/// Adds the given resource with the given state.
|
||||
pub fn add_single(&mut self, buffer: &Arc<Buffer<A>>, state: BufferUses) {
|
||||
self.buffers.push((buffer.clone(), state));
|
||||
pub fn insert_single(&mut self, buffer: Arc<Buffer<A>>, state: BufferUses) {
|
||||
self.buffers.push((buffer, state));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,16 +179,16 @@ impl<A: HalApi> TextureBindGroupState<A> {
|
||||
}
|
||||
|
||||
/// Adds the given resource with the given state.
|
||||
pub fn add_single(
|
||||
pub fn insert_single(
|
||||
&mut self,
|
||||
texture: &Arc<Texture<A>>,
|
||||
texture: Arc<Texture<A>>,
|
||||
selector: Option<TextureSelector>,
|
||||
state: TextureUses,
|
||||
usage: TextureUses,
|
||||
) {
|
||||
self.textures.push(TextureBindGroupStateData {
|
||||
selector,
|
||||
texture: texture.clone(),
|
||||
usage: state,
|
||||
texture,
|
||||
usage,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user