From 40022c1584824c99a9202e2ec6ba87890cc217ec Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:58:40 +0200 Subject: [PATCH] remove duplicate check, it's already present in `Device.create_texture_view` --- wgpu-core/src/device/global.rs | 7 ------- wgpu-core/src/resource.rs | 10 ---------- 2 files changed, 17 deletions(-) diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 720a57e89b..3ba8cfdb7a 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -706,13 +706,6 @@ impl Global { }); } - { - let snatch_guard = device.snatchable_lock.read(); - if let Err(e) = texture.check_destroyed(&snatch_guard) { - break 'error e.into(); - } - } - let view = match device.create_texture_view(&texture, desc) { Ok(view) => view, Err(e) => break 'error e, diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index a7b580c93b..4eb073b6b8 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -1075,16 +1075,6 @@ impl Texture { .ok_or_else(|| DestroyedResourceError(self.error_ident())) } - pub(crate) fn check_destroyed<'a>( - &'a self, - guard: &'a SnatchGuard, - ) -> Result<(), DestroyedResourceError> { - self.inner - .get(guard) - .map(|_| ()) - .ok_or_else(|| DestroyedResourceError(self.error_ident())) - } - pub(crate) fn inner_mut<'a>( &'a self, guard: &'a mut ExclusiveSnatchGuard,