diff --git a/CHANGELOG.md b/CHANGELOG.md index de11b30459..abfbe5ee78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,10 @@ Bottom level categories: ### Changes +#### General + +- Make `Surface::as_hal` take an immutable reference to the surface. By @jerzywilczek in [#9999](https://github.com/gfx-rs/wgpu/pull/9999) + #### HAL - Change the `DropCallback` API to use `FnOnce` instead of `FnMut`. By @jerzywilczek in [#6482](https://github.com/gfx-rs/wgpu/pull/6482) diff --git a/wgpu/src/api/surface.rs b/wgpu/src/api/surface.rs index 6e433596da..14b482850d 100644 --- a/wgpu/src/api/surface.rs +++ b/wgpu/src/api/surface.rs @@ -159,7 +159,7 @@ impl Surface<'_> { /// - The raw handle obtained from the hal Surface must not be manually destroyed #[cfg(wgpu_core)] pub unsafe fn as_hal) -> R, R>( - &mut self, + &self, hal_surface_callback: F, ) -> Option { self.context