Make Surface::as_hal take an immutable reference. (#6500)

This commit is contained in:
Jerzy Wilczek 2024-11-06 15:47:25 +01:00 committed by GitHub
parent 5936fe58f4
commit 9b47b06a4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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<A: wgc::hal_api::HalApi, F: FnOnce(Option<&A::Surface>) -> R, R>(
&mut self,
&self,
hal_surface_callback: F,
) -> Option<R> {
self.context