mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Fix aarch64-pc-windows-msvc (#6868)
This commit is contained in:
parent
991ee61026
commit
0dab31ab2a
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -88,6 +88,12 @@ jobs:
|
||||
target: x86_64-pc-windows-msvc
|
||||
kind: native
|
||||
|
||||
# Windows
|
||||
- name: Windows aarch64
|
||||
os: windows-2022
|
||||
target: aarch64-pc-windows-msvc
|
||||
kind: native
|
||||
|
||||
# MacOS
|
||||
- name: MacOS x86_64
|
||||
os: macos-14
|
||||
|
||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -2205,6 +2205,7 @@ name = "naga-fuzz"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"arbitrary",
|
||||
"cfg_aliases 0.2.1",
|
||||
"libfuzzer-sys",
|
||||
"naga",
|
||||
]
|
||||
|
||||
@ -5,6 +5,7 @@ authors = ["Automatically generated"]
|
||||
publish = false
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
build = "build.rs"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
@ -19,6 +20,9 @@ path = ".."
|
||||
version = "23.0.0"
|
||||
features = ["arbitrary", "spv-in", "wgsl-in", "glsl-in"]
|
||||
|
||||
[build-dependencies]
|
||||
cfg_aliases.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "spv_parser"
|
||||
path = "fuzz_targets/spv_parser.rs"
|
||||
|
||||
5
naga/fuzz/build.rs
Normal file
5
naga/fuzz/build.rs
Normal file
@ -0,0 +1,5 @@
|
||||
fn main() {
|
||||
cfg_aliases::cfg_aliases! {
|
||||
enable_fuzzing: { not(any(target_arch = "wasm32", target_os = "ios", all(windows, target_arch = "aarch64"))) },
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
#![no_main]
|
||||
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
|
||||
#![cfg_attr(enable_fuzzing, no_main)]
|
||||
|
||||
#[cfg(enable_fuzzing)]
|
||||
mod fuzz {
|
||||
use arbitrary::Arbitrary;
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
@ -47,3 +48,6 @@ mod fuzz {
|
||||
let _result = parser.parse(&options.into(), &source);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(enable_fuzzing))]
|
||||
fn main() {}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#![no_main]
|
||||
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
|
||||
#![cfg_attr(enable_fuzzing, no_main)]
|
||||
|
||||
#[cfg(enable_fuzzing)]
|
||||
mod fuzz {
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
@ -12,3 +13,6 @@ mod fuzz {
|
||||
let _result = validator.validate(&module);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(enable_fuzzing))]
|
||||
fn main() {}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#![no_main]
|
||||
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
|
||||
#![cfg_attr(enable_fuzzing, no_main)]
|
||||
|
||||
#[cfg(enable_fuzzing)]
|
||||
mod fuzz {
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use naga::front::spv::{Frontend, Options};
|
||||
@ -10,3 +11,6 @@ mod fuzz {
|
||||
let _result = Frontend::new(data.into_iter(), &options).parse();
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(enable_fuzzing))]
|
||||
fn main() {}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#![no_main]
|
||||
#[cfg(not(any(target_arch = "wasm32", target_os = "ios")))]
|
||||
#![cfg_attr(enable_fuzzing, no_main)]
|
||||
|
||||
#[cfg(enable_fuzzing)]
|
||||
mod fuzz {
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use naga::front::wgsl::Frontend;
|
||||
@ -9,3 +10,6 @@ mod fuzz {
|
||||
let _result = Frontend::new().parse(&data);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(enable_fuzzing))]
|
||||
fn main() {}
|
||||
|
||||
@ -165,13 +165,18 @@ windows = { workspace = true, optional = true }
|
||||
bit-set = { workspace = true, optional = true }
|
||||
range-alloc = { workspace = true, optional = true }
|
||||
gpu-allocator = { workspace = true, optional = true }
|
||||
mach-dxcompiler-rs = { workspace = true, optional = true }
|
||||
# For core macros. This crate is also reexported as windows::core.
|
||||
windows-core = { workspace = true, optional = true }
|
||||
|
||||
# backend: Gles
|
||||
glutin_wgl_sys = { workspace = true, optional = true }
|
||||
|
||||
# This doesn't support aarch64. See https://github.com/gfx-rs/wgpu/issues/6860.
|
||||
#
|
||||
# ⚠️ Keep in sync with static_dxc cfg in build.rs and cfg_alias in `wgpu` crate ⚠️
|
||||
[target.'cfg(all(windows, not(target_arch = "aarch64")))'.dependencies]
|
||||
mach-dxcompiler-rs = { workspace = true, optional = true }
|
||||
|
||||
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
|
||||
# backend: Metal
|
||||
block = { workspace = true, optional = true }
|
||||
|
||||
@ -10,6 +10,8 @@ fn main() {
|
||||
dx12: { all(target_os = "windows", feature = "dx12") },
|
||||
gles: { all(feature = "gles") },
|
||||
metal: { all(any(target_os = "ios", target_os = "macos"), feature = "metal") },
|
||||
vulkan: { all(not(target_arch = "wasm32"), feature = "vulkan") }
|
||||
vulkan: { all(not(target_arch = "wasm32"), feature = "vulkan") },
|
||||
// ⚠️ Keep in sync with target.cfg() definition in Cargo.toml and cfg_alias in `wgpu` crate ⚠️
|
||||
static_dxc: { all(target_os = "windows", feature = "static-dxc", not(target_arch = "aarch64")) }
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ pub(super) fn get_dynamic_dxc_container(
|
||||
|
||||
/// Creates a [`DxcContainer`] that delegates to the statically-linked version of DXC.
|
||||
pub(super) fn get_static_dxc_container() -> Result<DxcContainer, crate::DeviceError> {
|
||||
#[cfg(feature = "static-dxc")]
|
||||
#[cfg(static_dxc)]
|
||||
{
|
||||
unsafe {
|
||||
let compiler = dxc_create_instance::<Dxc::IDxcCompiler3>(|clsid, iid, ppv| {
|
||||
@ -206,7 +206,7 @@ pub(super) fn get_static_dxc_container() -> Result<DxcContainer, crate::DeviceEr
|
||||
})
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "static-dxc"))]
|
||||
#[cfg(not(static_dxc))]
|
||||
{
|
||||
panic!("Attempted to create a static DXC shader compiler, but the static-dxc feature was not enabled")
|
||||
}
|
||||
|
||||
@ -7692,7 +7692,9 @@ pub enum Dx12Compiler {
|
||||
dxil_path: PathBuf,
|
||||
},
|
||||
/// The statically-linked variant of Dxc.
|
||||
/// The `static-dxc` feature is required to use this.
|
||||
///
|
||||
/// The `static-dxc` feature is required for this setting to be used successfully on DX12.
|
||||
/// Not available on `windows-aarch64-pc-*` targets.
|
||||
StaticDxc,
|
||||
}
|
||||
|
||||
|
||||
@ -14,5 +14,7 @@ fn main() {
|
||||
// This alias is _only_ if _we_ need naga in the wrapper. wgpu-core provides
|
||||
// its own re-export of naga, which can be used in other situations
|
||||
naga: { any(feature = "naga-ir", feature = "spirv", feature = "glsl") },
|
||||
// ⚠️ Keep in sync with target.cfg() definition in wgpu-hal/Cargo.toml and cfg_alias in `wgpu-hal` crate ⚠️
|
||||
static_dxc: { all(target_os = "windows", feature = "static-dxc", not(target_arch = "aarch64")) },
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ pub fn dx12_shader_compiler_from_env() -> Option<wgt::Dx12Compiler> {
|
||||
dxc_path: std::path::PathBuf::from("dxcompiler.dll"),
|
||||
dxil_path: std::path::PathBuf::from("dxil.dll"),
|
||||
},
|
||||
#[cfg(feature = "static-dxc")]
|
||||
#[cfg(static_dxc)]
|
||||
Ok("static-dxc") => wgt::Dx12Compiler::StaticDxc,
|
||||
Ok("fxc") => wgt::Dx12Compiler::Fxc,
|
||||
_ => return None,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user