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:
teoxoy 2024-08-02 19:18:30 +02:00 committed by Teodor Tanasoaia
parent 826e3716e5
commit 62af9d78b5
3 changed files with 9 additions and 9 deletions

View File

@ -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)?;

View File

@ -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));
}
}

View File

@ -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,
});
}
}