From 1799b7f221ebbe36aaddc1b627e089d0bf4d3a83 Mon Sep 17 00:00:00 2001 From: gents83 Date: Sun, 26 Nov 2023 11:18:18 +0100 Subject: [PATCH] remove_abandoned fix --- wgpu-core/src/track/buffer.rs | 4 ++-- wgpu-core/src/track/metadata.rs | 9 +-------- wgpu-core/src/track/stateless.rs | 4 ++-- wgpu-core/src/track/texture.rs | 4 ++-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/wgpu-core/src/track/buffer.rs b/wgpu-core/src/track/buffer.rs index dc569ff842..090c45a4be 100644 --- a/wgpu-core/src/track/buffer.rs +++ b/wgpu-core/src/track/buffer.rs @@ -339,11 +339,11 @@ impl ResourceTracker> for BufferTracker { id, existing_ref_count ); + return false; } } } - - false + true } } diff --git a/wgpu-core/src/track/metadata.rs b/wgpu-core/src/track/metadata.rs index 8001776e8c..3464170ebf 100644 --- a/wgpu-core/src/track/metadata.rs +++ b/wgpu-core/src/track/metadata.rs @@ -122,14 +122,7 @@ impl> ResourceMetadata { /// 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`. diff --git a/wgpu-core/src/track/stateless.rs b/wgpu-core/src/track/stateless.rs index c312a6abba..09a0db92bc 100644 --- a/wgpu-core/src/track/stateless.rs +++ b/wgpu-core/src/track/stateless.rs @@ -113,11 +113,11 @@ impl> ResourceTracker id, existing_ref_count ); + return false; } } } - - false + true } } diff --git a/wgpu-core/src/track/texture.rs b/wgpu-core/src/track/texture.rs index f966f34709..2e06f5ae9e 100644 --- a/wgpu-core/src/track/texture.rs +++ b/wgpu-core/src/track/texture.rs @@ -428,11 +428,11 @@ impl ResourceTracker> for TextureTracker { id, existing_ref_count ); + return false; } } } - - false + true } }