Skip to content

Commit

Permalink
remove_abandoned fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gents83 committed Nov 26, 2023
1 parent 12ee31d commit 1799b7f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions wgpu-core/src/track/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ impl<A: HalApi> ResourceTracker<BufferId, Buffer<A>> for BufferTracker<A> {
id,
existing_ref_count
);
return false;
}
}
}

false
true
}
}

Expand Down
9 changes: 1 addition & 8 deletions wgpu-core/src/track/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,7 @@ impl<A: HalApi, I: TypedId, T: Resource<I>> ResourceMetadata<A, I, T> {
/// existing tables. See `tracker_assert_in_bounds`.
#[inline(always)]
pub(super) unsafe fn get_ref_count_unchecked(&self, index: usize) -> usize {
unsafe {
Arc::strong_count(
self.resources
.get_unchecked(index)
.as_ref()
.unwrap_unchecked(),
)
}
unsafe { Arc::strong_count(self.get_resource_unchecked(index)) }
}

/// Returns an iterator over the resources owned by `self`.
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/track/stateless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ impl<A: HalApi, Id: TypedId, T: Resource<Id>> ResourceTracker<Id, T>
id,
existing_ref_count
);
return false;
}
}
}

false
true
}
}

Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/track/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ impl<A: HalApi> ResourceTracker<TextureId, Texture<A>> for TextureTracker<A> {
id,
existing_ref_count
);
return false;
}
}
}

false
true
}
}

Expand Down

0 comments on commit 1799b7f

Please sign in to comment.