Refactor check_light_mesh_visibility for performance #2 #13906
Merged
alice-i-cecile merged 14 commits intobevyengine:mainfrom Jun 26, 2024
Merged
Refactor check_light_mesh_visibility for performance #2 #13906alice-i-cecile merged 14 commits intobevyengine:mainfrom
alice-i-cecile merged 14 commits intobevyengine:mainfrom
Conversation
Contributor
Author
|
Marking as draft until #13905 get merged. |
kristoff3r
suggested changes
Jun 18, 2024
Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com>
kristoff3r
approved these changes
Jun 20, 2024
Contributor
kristoff3r
left a comment
There was a problem hiding this comment.
Looks ok to me now, and I tested that many_cubes with shadows still works
IceSentry
approved these changes
Jun 26, 2024
Contributor
IceSentry
left a comment
There was a problem hiding this comment.
I'm not super familiar with this code, but the implementation makes sense to me and the perf gain look pretty good.
I tested various examples and they all seemed to work correctly.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
Solution
check_dir_light_mesh_visibility defers setting the entity's
ViewVisibilityso that Bevy can schedule it to run in parallel withcheck_point_light_mesh_visibility.Reduce HashMap lookups for directional light checking as much as possible
Use
par_iterto parallelize the checking process within each system.