Skip to content

Commit

Permalink
added support for aarch64 ios simulator (#3783)
Browse files Browse the repository at this point in the history
* added support for aarch64 ios simulator

* remove dependency on nightly feature

* fix missing newline at end of file
  • Loading branch information
geertbleyen authored Aug 3, 2021
1 parent 2c8db0b commit bc77309
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/backend/metal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ readme = "README.md"
documentation = "https://docs.rs/gfx-backend-metal"
workspace = "../../.."
edition = "2018"
build = "build/build.rs"

[features]
#TODO: add a feature to enable `profiling`, so that we can CI test it
Expand Down
6 changes: 6 additions & 0 deletions src/backend/metal/build/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main() {
println!(
"cargo:rustc-env=TARGET={}",
std::env::var("TARGET").unwrap()
);
}
6 changes: 5 additions & 1 deletion src/backend/metal/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,11 @@ impl ServicePipes {
let data = if cfg!(target_os = "macos") {
&include_bytes!("./../shaders/gfx-shaders-macos.metallib")[..]
} else if cfg!(target_arch = "aarch64") {
&include_bytes!("./../shaders/gfx-shaders-ios.metallib")[..]
if env!("TARGET") == "aarch64-apple-ios-sim" {
&include_bytes!("./../shaders/gfx-shaders-ios-simulator.metallib")[..]
} else {
&include_bytes!("./../shaders/gfx-shaders-ios.metallib")[..]
}
} else {
&include_bytes!("./../shaders/gfx-shaders-ios-simulator.metallib")[..]
};
Expand Down

0 comments on commit bc77309

Please sign in to comment.