Skip to content

Commit

Permalink
use unstable sort
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jan 5, 2022
1 parent 80ce18e commit 7095163
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_sprite/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ pub fn prepare_sprites(

// sort first by z and then by handle. this ensures that, when possible, batches span multiple z layers
// batches won't span z-layers if there is another batch between them
extracted_sprites.sprites.sort_by(|a, b| {
extracted_sprites.sprites.sort_unstable_by(|a, b| {
match a.transform.w_axis[2].partial_cmp(&b.transform.w_axis[2]) {
Some(Ordering::Equal) | None => a.handle.cmp(&b.handle),
Some(other) => other,
Expand Down

0 comments on commit 7095163

Please sign in to comment.