From 9b47b06a4f828156aeb61b027b163a5ed2cb3e2d Mon Sep 17 00:00:00 2001 From: Jerzy Wilczek <72213407+jerzywilczek@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:47:25 +0100 Subject: [PATCH] Make `Surface::as_hal` take an immutable reference. (#6500) --- CHANGELOG.md | 4 ++++ wgpu/src/api/surface.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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