summaryrefslogtreecommitdiffstats
path: root/wgpu/src/buffers
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wgpu/src/buffers.rs3
-rw-r--r--wgpu/src/buffers/dynamic.rs4
2 files changed, 3 insertions, 4 deletions
diff --git a/wgpu/src/buffers.rs b/wgpu/src/buffers.rs
index 34fe0fca..707ad832 100644
--- a/wgpu/src/buffers.rs
+++ b/wgpu/src/buffers.rs
@@ -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();
diff --git a/wgpu/src/buffers/dynamic.rs b/wgpu/src/buffers/dynamic.rs
index 3c65d6e1..f1262d83 100644
--- a/wgpu/src/buffers/dynamic.rs
+++ b/wgpu/src/buffers/dynamic.rs
@@ -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
}