mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-25 00:04:15 +00:00
Remove redundant unsafe
This commit is contained in:
parent
521a93f363
commit
4e04359e40
@ -179,19 +179,17 @@ unsafe fn winit_to_surface(instance: Arc<Instance>, win: &winit::Window)
|
||||
-> Result<Arc<Surface>, SurfaceCreationError> {
|
||||
use winit::os::macos::WindowExt;
|
||||
|
||||
unsafe {
|
||||
let wnd: cocoa_id = mem::transmute(win.get_nswindow());
|
||||
let wnd: cocoa_id = mem::transmute(win.get_nswindow());
|
||||
|
||||
let layer = CAMetalLayer::new();
|
||||
let layer = CAMetalLayer::new();
|
||||
|
||||
layer.set_edge_antialiasing_mask(0);
|
||||
layer.set_presents_with_transaction(false);
|
||||
layer.remove_all_animations();
|
||||
layer.set_edge_antialiasing_mask(0);
|
||||
layer.set_presents_with_transaction(false);
|
||||
layer.remove_all_animations();
|
||||
|
||||
let view = wnd.contentView();
|
||||
view.setWantsLayer(YES);
|
||||
view.setLayer(mem::transmute(layer.0)); // Bombs here with out of memory
|
||||
}
|
||||
let view = wnd.contentView();
|
||||
view.setWantsLayer(YES);
|
||||
view.setLayer(mem::transmute(layer.0)); // Bombs here with out of memory
|
||||
|
||||
Surface::from_macos_moltenvk(instance, win.get_nsview() as *const ())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user