diff --git a/wgpu-core-remote/src/global/as_hal.rs b/wgpu-core-remote/src/global/as_hal.rs deleted file mode 100644 index e3a842c7b..000000000 --- a/wgpu-core-remote/src/global/as_hal.rs +++ /dev/null @@ -1,124 +0,0 @@ -use core::ops::Deref; - -use crate::global::Global; -use crate::id::*; - -impl Global { - /// # Safety - /// - /// - The raw buffer handle must not be manually destroyed - pub unsafe fn buffer_as_hal( - &self, - id: BufferId, - ) -> Option> { - let hub = &self.hub.borrow(); - - let buffer = hub.buffers.get(id); - - unsafe { buffer.as_hal::() } - } - - /// # Safety - /// - /// - The raw texture handle must not be manually destroyed - pub unsafe fn texture_as_hal( - &self, - id: TextureId, - ) -> Option> { - let hub = &self.hub.borrow(); - - let texture = hub.textures.get(id); - - unsafe { texture.as_hal::() } - } - - /// # Safety - /// - /// - The raw texture view handle must not be manually destroyed - pub unsafe fn texture_view_as_hal( - &self, - id: TextureViewId, - ) -> Option> { - let hub = &self.hub.borrow(); - - let view = hub.texture_views.get(id); - - unsafe { view.as_hal::() } - } - - /// # Safety - /// - /// - The raw adapter handle must not be manually destroyed - pub unsafe fn adapter_as_hal( - &self, - id: AdapterId, - ) -> Option> { - let hub = &self.hub.borrow(); - let adapter = hub.adapters.get(id); - - unsafe { adapter.as_hal::() } - } - - /// # Safety - /// - /// - The raw device handle must not be manually destroyed - pub unsafe fn device_as_hal( - &self, - id: DeviceId, - ) -> Option> { - let hub = &self.hub.borrow(); - let device = hub.devices.get(id); - - unsafe { device.as_hal::() } - } - - /// # Safety - /// - /// - The raw fence handle must not be manually destroyed - pub unsafe fn device_fence_as_hal( - &self, - id: DeviceId, - ) -> Option> { - let hub = &self.hub.borrow(); - let device = hub.devices.get(id); - - unsafe { device.fence_as_hal::() } - } - - /// Encode commands using the raw HAL command encoder. - /// - /// # Panics - /// - /// If the command encoder has already been used with the wgpu encoding API. - /// - /// # Safety - /// - /// - The raw command encoder handle must not be manually destroyed - pub unsafe fn command_encoder_as_hal_mut< - A: hal::Api, - F: FnOnce(Option<&mut A::CommandEncoder>) -> R, - R, - >( - &self, - id: CommandEncoderId, - hal_command_encoder_callback: F, - ) -> R { - let hub = &self.hub.borrow(); - - let cmd_enc = hub.command_encoders.get(id); - unsafe { cmd_enc.as_hal_mut::(hal_command_encoder_callback) } - } - - /// # Safety - /// - /// - The raw queue handle must not be manually destroyed - pub unsafe fn queue_as_hal( - &self, - id: QueueId, - ) -> Option> { - let hub = &self.hub.borrow(); - let queue = hub.queues.get(id); - - unsafe { queue.as_hal::() } - } -} diff --git a/wgpu-core-remote/src/global/mod.rs b/wgpu-core-remote/src/global/mod.rs index af8415e16..d7e3a8b03 100644 --- a/wgpu-core-remote/src/global/mod.rs +++ b/wgpu-core-remote/src/global/mod.rs @@ -15,7 +15,6 @@ use crate::id::{ DeviceId, PipelineLayoutId, QuerySetId, QueueId, RenderPipelineId, TextureId, }; -mod as_hal; mod bundle; mod command_encoder; mod compute_pass;