465: Fix Vulkan portability support on macOS r=cwfitzgerald a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot]andDzmitry Malyshau authored and GitHub committed 2020-07-22 14:40:09 +00:00
commit 4e49a60804
3 files changed
+8 -5

No files matched your search

+6 -3
View File
@@ -1036,6 +1036,11 @@ impl Instance {
}
}
/// Creates a surface from `CoreAnimationLayer`.
///
/// # Safety
///
/// - layer must be a valid object to create a surface upon.
#[cfg(any(target_os = "ios", target_os = "macos"))]
pub unsafe fn create_surface_from_core_animation_layer(
&self,
@@ -1043,9 +1048,7 @@ impl Instance {
) -> Surface {
let surface = wgc::instance::Surface {
#[cfg(feature = "vulkan-portability")]
vulkan: self.context.instance.vulkan.as_ref().map(|inst| {
inst.create_surface_from_layer(layer as *mut _, cfg!(debug_assertions))
}),
vulkan: None, //TODO: create_surface_from_layer ?
metal: self.context.instance.metal.as_ref().map(|inst| {
inst.create_surface_from_layer(layer as *mut _, cfg!(debug_assertions))
}),