forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bevy_pbr: Optimize assign_lights_to_clusters (bevyengine#3984)
# Objective - Optimize assign_lights_to_clusters ## Solution - Avoid inserting entities into hash sets in inner loops when it is known they will be inserted in at least one iteration of the loop. - Use a Vec instead of a hash set where the set is not needed - Avoid explicit calculation of the cluster_index from x,y,z coordinates, instead using row and column offsets and just adding z in the inner loop - These changes cut the time spent in the system roughly in half
- Loading branch information
Showing
1 changed file
with
11 additions
and
10 deletions.
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