-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] - Do not create nor execute render passes which have no phase items to draw #4643
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ impl Node for MainPass3dNode { | |
Err(_) => return Ok(()), // No window | ||
}; | ||
|
||
{ | ||
if !opaque_phase.items.is_empty() { | ||
// Run the opaque pass, sorted front-to-back | ||
// NOTE: Scoped to drop the mutable borrow of render_context | ||
#[cfg(feature = "trace")] | ||
|
@@ -92,7 +92,7 @@ impl Node for MainPass3dNode { | |
} | ||
} | ||
|
||
{ | ||
if !alpha_mask_phase.items.is_empty() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto here. |
||
// Run the alpha mask pass, sorted front-to-back | ||
// NOTE: Scoped to drop the mutable borrow of render_context | ||
#[cfg(feature = "trace")] | ||
|
@@ -128,7 +128,7 @@ impl Node for MainPass3dNode { | |
} | ||
} | ||
|
||
{ | ||
if !transparent_phase.items.is_empty() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto here. |
||
// Run the transparent pass, sorted back-to-front | ||
// NOTE: Scoped to drop the mutable borrow of render_context | ||
#[cfg(feature = "trace")] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we move this check inside the tracing span? This could impact profile output and averages across multiple frames if applied inconsistently.
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 feel like it would mess up mean and median execution times if we count the zeros, so to speak. If the pass runs once per 10 frames for whatever reason, would we want to see a mean that is 1/10th the single-frame execution time? I feel like not.
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.
It may be a matter of expectations.
If it's viewed from the perspective of "how much frame time does this section take on average?", I'd say counting the zeroes here is accurate, and properly reflects the performance changes that do affect the phase. If the phase is only in use 10% of the time, any optimization made within each will only impact 10% of the frames.
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 see your point. I just disagree. :)
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’ll merge it like this and if it turns out to be the wrong call, it is easy to change. I’m thinking that frame time consistency is more important than throughout. If you do something once every 10 frames and it makes for a significant frame stutter, that’s bad. So averaging over only three instances where the thing actually happens seems like the preference. Maybe I’m wrong. Or maybe we need both for different situations.