From 4574ec41259f42dceea4f770290d9975a8943db0 Mon Sep 17 00:00:00 2001 From: Micha White Date: Thu, 13 Oct 2022 21:07:54 -0400 Subject: Be less picky about function size --- src/instance.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/instance.rs') diff --git a/src/instance.rs b/src/instance.rs index 3479b67..bacad56 100644 --- a/src/instance.rs +++ b/src/instance.rs @@ -78,12 +78,7 @@ impl InstanceBuffer { pub(crate) fn new(device: &wgpu::Device, capacity: usize) -> Self { let instances = Vec::with_capacity(capacity); let instance_buffer_size = instances.capacity(); - let instance_buffer = device.create_buffer(&wgpu::BufferDescriptor { - label: Some("Sprite Instance Buffer"), - size: (instance_buffer_size * size_of::()) as wgpu::BufferAddress, - usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST, - mapped_at_creation: false, - }); + let instance_buffer = create_buffer(device, &instances); Self { instances, -- cgit v1.2.3