mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
[hal] Make Vulkan and GLES not depend on Metal-specific dependencies
This commit is contained in:
parent
ffabb52f57
commit
9a5e646464
@ -44,6 +44,9 @@ metal = [
|
|||||||
# Metal is only available on Apple platforms, therefore request MSL output also only if we target an Apple platform.
|
# Metal is only available on Apple platforms, therefore request MSL output also only if we target an Apple platform.
|
||||||
"naga/msl-out-if-target-apple",
|
"naga/msl-out-if-target-apple",
|
||||||
"dep:block",
|
"dep:block",
|
||||||
|
"dep:core-graphics-types",
|
||||||
|
"dep:metal",
|
||||||
|
"dep:objc",
|
||||||
"dep:raw-window-metal",
|
"dep:raw-window-metal",
|
||||||
]
|
]
|
||||||
vulkan = [
|
vulkan = [
|
||||||
@ -52,9 +55,9 @@ vulkan = [
|
|||||||
"dep:gpu-alloc",
|
"dep:gpu-alloc",
|
||||||
"dep:gpu-descriptor",
|
"dep:gpu-descriptor",
|
||||||
"dep:libloading",
|
"dep:libloading",
|
||||||
|
"dep:raw-window-metal",
|
||||||
"dep:smallvec",
|
"dep:smallvec",
|
||||||
"dep:android_system_properties",
|
"dep:android_system_properties",
|
||||||
"dep:raw-window-metal",
|
|
||||||
]
|
]
|
||||||
gles = [
|
gles = [
|
||||||
"naga/glsl-out",
|
"naga/glsl-out",
|
||||||
@ -63,6 +66,7 @@ gles = [
|
|||||||
"dep:khronos-egl",
|
"dep:khronos-egl",
|
||||||
"dep:libloading",
|
"dep:libloading",
|
||||||
"dep:ndk-sys",
|
"dep:ndk-sys",
|
||||||
|
"dep:objc",
|
||||||
"windows/Win32_Graphics_OpenGL",
|
"windows/Win32_Graphics_OpenGL",
|
||||||
"windows/Win32_Graphics_Gdi",
|
"windows/Win32_Graphics_Gdi",
|
||||||
"windows/Win32_System_LibraryLoader",
|
"windows/Win32_System_LibraryLoader",
|
||||||
@ -167,14 +171,15 @@ glutin_wgl_sys = { workspace = true, optional = true }
|
|||||||
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
|
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
|
||||||
# backend: Metal
|
# backend: Metal
|
||||||
block = { workspace = true, optional = true }
|
block = { workspace = true, optional = true }
|
||||||
|
metal = { workspace = true, optional = true }
|
||||||
|
core-graphics-types = { workspace = true, optional = true }
|
||||||
|
|
||||||
|
# backend: Metal + GLES
|
||||||
|
objc = { workspace = true, optional = true }
|
||||||
|
|
||||||
# backend: Metal + Vulkan
|
# backend: Metal + Vulkan
|
||||||
raw-window-metal = { workspace = true, optional = true }
|
raw-window-metal = { workspace = true, optional = true }
|
||||||
|
|
||||||
metal.workspace = true
|
|
||||||
objc.workspace = true
|
|
||||||
core-graphics-types.workspace = true
|
|
||||||
|
|
||||||
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
|
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
|
||||||
wasm-bindgen.workspace = true
|
wasm-bindgen.workspace = true
|
||||||
web-sys = { workspace = true, features = [
|
web-sys = { workspace = true, features = [
|
||||||
|
@ -511,7 +511,7 @@ impl super::Instance {
|
|||||||
Ok(self.create_surface_from_vk_surface_khr(surface))
|
Ok(self.create_surface_from_vk_surface_khr(surface))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(metal)]
|
#[cfg(target_vendor = "apple")]
|
||||||
fn create_surface_from_layer(
|
fn create_surface_from_layer(
|
||||||
&self,
|
&self,
|
||||||
layer: raw_window_metal::Layer,
|
layer: raw_window_metal::Layer,
|
||||||
|
Loading…
Reference in New Issue
Block a user