From 11077150cbc909e414cf5b27f18d02629e6b01da Mon Sep 17 00:00:00 2001 From: Micha White Date: Thu, 20 Oct 2022 23:19:00 -0400 Subject: Made the run function generic --- alligator_render/src/instance.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'alligator_render/src/instance.rs') diff --git a/alligator_render/src/instance.rs b/alligator_render/src/instance.rs index 2d1808f..e346cae 100644 --- a/alligator_render/src/instance.rs +++ b/alligator_render/src/instance.rs @@ -151,8 +151,12 @@ impl InstanceBuffer { } // the instances must be sorted by z-index before being handed to the GPU - let mut sorted = self.instances.clone(); - sorted.sort_by(|a, b| a.z_index.total_cmp(&b.z_index)); + let sorted = { + profiling::scope!("depth sorting"); + let mut sorted = self.instances.clone(); + sorted.sort_by(|a, b| a.z_index.total_cmp(&b.z_index)); + sorted + }; queue.write_buffer( &self.instance_buffer, -- cgit v1.2.3