From f3e8e594ed7b482a9c208b048d5b95d95eb57841 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:26:30 +0200 Subject: [PATCH] remove `Hub.surface_unconfigure()` since the `Hub` reference was unused. --- wgpu-core/src/hub.rs | 7 ------- wgpu-core/src/instance.rs | 18 +++++++----------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/wgpu-core/src/hub.rs b/wgpu-core/src/hub.rs index 559f3c47c..a5b1e5982 100644 --- a/wgpu-core/src/hub.rs +++ b/wgpu-core/src/hub.rs @@ -263,13 +263,6 @@ impl Hub { } } - pub(crate) fn surface_unconfigure(&self, device: &Device, surface: &A::Surface) { - unsafe { - use hal::Surface; - surface.unconfigure(device.raw()); - } - } - pub fn generate_report(&self) -> HubReport { HubReport { adapters: self.adapters.generate_report(), diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index 1a74de83e..1b65b0c9b 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -662,15 +662,11 @@ impl Global { api_log!("Surface::drop {id:?}"); - fn unconfigure( - global: &Global, - surface: &Option>, - present: &Presentation, - ) { + fn unconfigure(surface: &Option>, present: &Presentation) { if let Some(surface) = surface { - let hub = HalApi::hub(global); if let Some(device) = present.device.downcast_ref::() { - hub.surface_unconfigure(device, surface); + use hal::Surface; + unsafe { surface.unconfigure(device.raw()) }; } } } @@ -681,13 +677,13 @@ impl Global { if let Some(present) = surface.presentation.lock().take() { #[cfg(vulkan)] - unconfigure::(self, &surface.vulkan, &present); + unconfigure::(&surface.vulkan, &present); #[cfg(metal)] - unconfigure::(self, &surface.metal, &present); + unconfigure::(&surface.metal, &present); #[cfg(dx12)] - unconfigure::(self, &surface.dx12, &present); + unconfigure::(&surface.dx12, &present); #[cfg(gles)] - unconfigure::(self, &surface.gl, &present); + unconfigure::(&surface.gl, &present); } drop(surface) }