mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Fix iOS crash: don't set autoresizing mask (#6535)
This commit is contained in:
parent
278620be26
commit
4681f4ffba
@ -139,6 +139,10 @@ By @ErichDonGubler in [#6456](https://github.com/gfx-rs/wgpu/pull/6456), [#6148]
|
||||
|
||||
- Fix surface capabilities being advertised when its query failed. By @wumpf in [#6510](https://github.com/gfx-rs/wgpu/pull/6510)
|
||||
|
||||
### Metal
|
||||
|
||||
- Fix surface creation crashing on iOS. By @mockersf in [#6535](https://github.com/gfx-rs/wgpu/pull/6535)
|
||||
|
||||
|
||||
## 23.0.0 (2024-10-25)
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#![allow(clippy::let_unit_value)] // `let () =` being used to constrain result type
|
||||
|
||||
use std::ffi::c_uint;
|
||||
use std::mem::ManuallyDrop;
|
||||
use std::ptr::NonNull;
|
||||
use std::sync::Once;
|
||||
@ -207,6 +206,8 @@ impl super::Surface {
|
||||
let new_layer: *mut Object = msg_send![class!(CAMetalLayer), new];
|
||||
let () = msg_send![root_layer, addSublayer: new_layer];
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
// Automatically resize the sublayer's frame to match the
|
||||
// superlayer's bounds.
|
||||
//
|
||||
@ -222,8 +223,9 @@ impl super::Surface {
|
||||
// (as we may do, see above).
|
||||
let width_sizable = 1 << 1; // kCALayerWidthSizable
|
||||
let height_sizable = 1 << 4; // kCALayerHeightSizable
|
||||
let mask: c_uint = width_sizable | height_sizable;
|
||||
let mask: std::ffi::c_uint = width_sizable | height_sizable;
|
||||
let () = msg_send![new_layer, setAutoresizingMask: mask];
|
||||
}
|
||||
|
||||
// Specify the relative size that the auto resizing mask above
|
||||
// will keep (i.e. tell it to fill out its superlayer).
|
||||
|
Loading…
Reference in New Issue
Block a user