Skip to content

Commit bc77309

Browse files
authored
added support for aarch64 ios simulator (#3783)
* added support for aarch64 ios simulator * remove dependency on nightly feature * fix missing newline at end of file
1 parent 2c8db0b commit bc77309

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/backend/metal/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ readme = "README.md"
1111
documentation = "https://docs.rs/gfx-backend-metal"
1212
workspace = "../../.."
1313
edition = "2018"
14+
build = "build/build.rs"
1415

1516
[features]
1617
#TODO: add a feature to enable `profiling`, so that we can CI test it

src/backend/metal/build/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
println!(
3+
"cargo:rustc-env=TARGET={}",
4+
std::env::var("TARGET").unwrap()
5+
);
6+
}

src/backend/metal/src/internal.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,11 @@ impl ServicePipes {
456456
let data = if cfg!(target_os = "macos") {
457457
&include_bytes!("./../shaders/gfx-shaders-macos.metallib")[..]
458458
} else if cfg!(target_arch = "aarch64") {
459-
&include_bytes!("./../shaders/gfx-shaders-ios.metallib")[..]
459+
if env!("TARGET") == "aarch64-apple-ios-sim" {
460+
&include_bytes!("./../shaders/gfx-shaders-ios-simulator.metallib")[..]
461+
} else {
462+
&include_bytes!("./../shaders/gfx-shaders-ios.metallib")[..]
463+
}
460464
} else {
461465
&include_bytes!("./../shaders/gfx-shaders-ios-simulator.metallib")[..]
462466
};

0 commit comments

Comments
 (0)