remove Hub.surface_unconfigure() since the Hub reference was unused.

This commit is contained in:
teoxoy 2024-07-03 15:26:30 +02:00 committed by Teodor Tanasoaia
parent 1cb7ebab99
commit f3e8e594ed
2 changed files with 7 additions and 18 deletions

View File

@ -263,13 +263,6 @@ impl<A: HalApi> Hub<A> {
}
}
pub(crate) fn surface_unconfigure(&self, device: &Device<A>, surface: &A::Surface) {
unsafe {
use hal::Surface;
surface.unconfigure(device.raw());
}
}
pub fn generate_report(&self) -> HubReport {
HubReport {
adapters: self.adapters.generate_report(),

View File

@ -662,15 +662,11 @@ impl Global {
api_log!("Surface::drop {id:?}");
fn unconfigure<A: HalApi>(
global: &Global,
surface: &Option<HalSurface<A>>,
present: &Presentation,
) {
fn unconfigure<A: HalApi>(surface: &Option<HalSurface<A>>, present: &Presentation) {
if let Some(surface) = surface {
let hub = HalApi::hub(global);
if let Some(device) = present.device.downcast_ref::<A>() {
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::<hal::api::Vulkan>(self, &surface.vulkan, &present);
unconfigure::<hal::api::Vulkan>(&surface.vulkan, &present);
#[cfg(metal)]
unconfigure::<hal::api::Metal>(self, &surface.metal, &present);
unconfigure::<hal::api::Metal>(&surface.metal, &present);
#[cfg(dx12)]
unconfigure::<hal::api::Dx12>(self, &surface.dx12, &present);
unconfigure::<hal::api::Dx12>(&surface.dx12, &present);
#[cfg(gles)]
unconfigure::<hal::api::Gles>(self, &surface.gl, &present);
unconfigure::<hal::api::Gles>(&surface.gl, &present);
}
drop(surface)
}