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 authored and Teodor Tanasoaia committed 2024-08-03 11:58:14 +02:00
1 parent 826e3716e5
commit 62af9d78b5
3 files changed
+9 -9

No files matched your search

+2 -2
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)?;
+2 -2
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));
}
}
+5 -5
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,
});
}
}