-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Automatic System Spans #2033
Conversation
#[cfg(feature = "trace")] | ||
let trace_path = Some(std::path::Path::new("wgpu_trace")); | ||
let trace_path = { | ||
let path = std::path::Path::new("wgpu_trace"); | ||
// ignore potential error, wgpu will log it | ||
let _ = std::fs::create_dir(path); | ||
Some(path) | ||
}; | ||
#[cfg(not(feature = "trace"))] | ||
let trace_path = None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole block could be cobined into a if cfg!(...)
expression which would be clearer imo.
let trace_path = if cfg!(feature = "trace") {
let path = std::path::Path::new("wgpu_trace");
// ignore potential error, wgpu will log it
let _ = std::fs::create_dir(path);
Some(path)
} else {
None
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the current way as I feel it's less work for the compiler.
But then this should be very simple to compile away... 🤷
Just wanted to voice my appreciation for how often you quickly pick up and implement work that "needs to be done" (and its generally exactly what we need). You've done a lot to improve the quality of Bevy in a ton of different areas and its awesome to see. |
Co-Authored-By: TehPers <[email protected]>
bors r+ |
As mentioned in #2025 (comment), systems used to have spans by default. * add spans by default for every system executed * create folder if missing for feature `wgpu_trace`
Pull request successfully merged into main. Build succeeded: |
As mentioned in bevyengine#2025 (comment), systems used to have spans by default. * add spans by default for every system executed * create folder if missing for feature `wgpu_trace`
As mentioned in bevyengine#2025 (comment), systems used to have spans by default. * add spans by default for every system executed * create folder if missing for feature `wgpu_trace`
As mentioned in #2025 (comment), systems used to have spans by default.
wgpu_trace