Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mopro-msm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ default = ["macos"]

macos = []
ios = []
profiling-release = []

[dependencies]
## Shared dependencies
Expand Down
11 changes: 2 additions & 9 deletions mopro-msm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ fn compile_shaders() {
get_sdk(),
"metal",
"-c",
"-frecord-sources",
shader_path.to_str().unwrap(),
"-o",
air_output.to_str().unwrap(),
];

if std::env::var("PROFILE")
.map(|profile| profile == "release")
.unwrap_or(false)
{
if cfg!(feature = "profiling-release") {
args.push("-frecord-sources");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions here:

  1. Do we generate Metal Library Symbol File via this argument (-frecord-release)?
  2. do we use the symbol files to do the profile our shaders?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sure

  1. We do, according to this -frecord-release this attribute does exactly this, that's why I moved it into the separate feature.
  2. It's not quite, we're not required these symbols to be provided to exactly be capable to profile, but we still required these symbols to be provided to be capable to see what exactly shader is running. They're pretty much the same as the symbol files for ordinary binaries, they do nothing more but to enrich debug data with the exact function names (shader names in case of metal shaders obviously).
  3. According the same source we can skip the .air intermediate compilation step and to compile shaders to its binary representation in a single shot, but I decided to implement this improvement after the refactor(metal_mont_backend): adapted from https://github.com/geometryxyz/msl-secp256k1 #13 will be merged.

}

Expand Down Expand Up @@ -62,10 +58,7 @@ fn compile_shaders() {
metallib_output.to_str().unwrap(),
];

if std::env::var("PROFILE")
.map(|profile| profile == "release")
.unwrap_or(false)
{
if cfg!(feature = "profiling-release") {
metallib_args.push("-frecord-sources");
}

Expand Down
Loading