mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
[rs] Fix Vulkan portability support on macOS
This commit is contained in:
parent
fcb39a1de6
commit
1bb52d8104
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
include:
|
||||
- os: macos-10.15
|
||||
wasm: false
|
||||
CHECK_COMMAND: cargo check --all-targets
|
||||
CHECK_COMMAND: cargo check --all-targets --features vulkan-portability
|
||||
TEST_COMMAND: cargo test --all-targets --no-run
|
||||
- os: ubuntu-18.04
|
||||
wasm: false
|
||||
|
@ -21,7 +21,7 @@ trace = ["serde", "wgc/trace"]
|
||||
replay = ["serde", "wgc/replay"]
|
||||
subscriber = ["wgc/subscriber"]
|
||||
# Make Vulkan backend available on platforms where it is by default not, e.g. macOS
|
||||
vulkan = ["wgc/gfx-backend-vulkan"]
|
||||
vulkan-portability = ["wgc/gfx-backend-vulkan"]
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
|
||||
package = "wgpu-core"
|
||||
|
@ -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))
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user