diff options
Diffstat (limited to 'render/src/instance.rs')
| -rw-r--r-- | render/src/instance.rs | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/render/src/instance.rs b/render/src/instance.rs index e346cae..15317c7 100644 --- a/render/src/instance.rs +++ b/render/src/instance.rs @@ -18,12 +18,6 @@ pub struct Instance { pub texture_coordinates: [f32; 2], /// The size of the sprite's texture pub texture_size: [f32; 2], - /// The index of the texture atlas to use - pub texture_atlas_index: u32, - /// Rotation, in radians - pub rotation: f32, - /// z-index - pub z_index: f32, } impl Default for Instance { @@ -31,11 +25,8 @@ impl Default for Instance { Self { position: [0.0; 2], size: [1.0; 2], - rotation: 0.0, - z_index: 0.0, texture_coordinates: [0.0; 2], texture_size: [1.0; 2], - texture_atlas_index: 0, } } } @@ -150,18 +141,10 @@ impl InstanceBuffer { self.expand_buffer(device); } - // the instances must be sorted by z-index before being handed to the GPU - 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, 0 as wgpu::BufferAddress, - bytemuck::cast_slice(&sorted), + bytemuck::cast_slice(&self.instances), ); } } |
