diff options
author | 2019-10-31 01:41:04 +0100 | |
---|---|---|
committer | 2019-10-31 01:41:04 +0100 | |
commit | 298c42ac5f208745cd3b23b3cc8f10f7c8769797 (patch) | |
tree | ed59801ab1194540fae6f8507a7eb83e152dcbd0 /wgpu/src/quad.rs | |
parent | 85916c9e8710ee90cbf37d384acbb6d208ff1da3 (diff) | |
download | iced-298c42ac5f208745cd3b23b3cc8f10f7c8769797.tar.gz iced-298c42ac5f208745cd3b23b3cc8f10f7c8769797.tar.bz2 iced-298c42ac5f208745cd3b23b3cc8f10f7c8769797.zip |
Replace `nalgebra` with `glam`
`glam` compiles much faster and leverages SIMD nicely.
Diffstat (limited to 'wgpu/src/quad.rs')
-rw-r--r-- | wgpu/src/quad.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/wgpu/src/quad.rs b/wgpu/src/quad.rs index 6365e117..bfbd7e2d 100644 --- a/wgpu/src/quad.rs +++ b/wgpu/src/quad.rs @@ -23,14 +23,12 @@ impl Pipeline { }], }); - let matrix: [f32; 16] = Transformation::identity().into(); - let transform = device .create_buffer_mapped( 16, wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST, ) - .fill_from_slice(&matrix[..]); + .fill_from_slice(Transformation::identity().as_ref()); let constants = device.create_bind_group(&wgpu::BindGroupDescriptor { layout: &constant_layout, @@ -169,11 +167,9 @@ impl Pipeline { bounds: Rectangle<u32>, target: &wgpu::TextureView, ) { - let matrix: [f32; 16] = transformation.into(); - let transform_buffer = device .create_buffer_mapped(16, wgpu::BufferUsage::COPY_SRC) - .fill_from_slice(&matrix[..]); + .fill_from_slice(transformation.as_ref()); encoder.copy_buffer_to_buffer( &transform_buffer, |