Fix lints by clippy
This commit is contained in:
parent
edce457365
commit
7e22e2d452
9 changed files with 20 additions and 28 deletions
|
|
@ -57,8 +57,7 @@ impl<T: Pod + Zeroable> StaticBuffer<T> {
|
|||
/// Returns whether or not the buffer needs to be recreated. This can happen whenever mesh data
|
||||
/// changes & a redraw is requested.
|
||||
pub fn resize(&mut self, device: &wgpu::Device, new_count: usize) -> bool {
|
||||
let size =
|
||||
wgpu::BufferAddress::from((mem::size_of::<T>() * new_count) as u64);
|
||||
let size = (mem::size_of::<T>() * new_count) as u64;
|
||||
|
||||
if self.size < size {
|
||||
self.offsets.clear();
|
||||
|
|
|
|||
|
|
@ -180,8 +180,8 @@ impl<T: ShaderType + WriteInto> Buffer<T> {
|
|||
let offset = self
|
||||
.offsets
|
||||
.get(index)
|
||||
.expect("Index not found in offsets.")
|
||||
.clone();
|
||||
.copied()
|
||||
.expect("Index not found in offsets.");
|
||||
|
||||
offset
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@ impl Pipeline {
|
|||
&mesh.buffers.indices,
|
||||
);
|
||||
|
||||
vertex_offset = vertex_offset + new_vertex_offset;
|
||||
index_offset = index_offset + new_index_offset;
|
||||
vertex_offset += new_vertex_offset;
|
||||
index_offset += new_index_offset;
|
||||
|
||||
self.index_strides.push(mesh.buffers.indices.len() as u32);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ impl Pipeline {
|
|||
});
|
||||
|
||||
let bind_group =
|
||||
Pipeline::bind_group(device, &buffer.raw(), &bind_group_layout);
|
||||
Pipeline::bind_group(device, buffer.raw(), &bind_group_layout);
|
||||
|
||||
let layout =
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue