diff --git a/src/buffer.rs b/src/buffer.rs index 441f2e3..256daab 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -15,12 +15,7 @@ pub struct BulkBufferBuilder<'a> { impl<'a> BulkBufferBuilder<'a> { pub fn new() -> Self { - Self { - order: vec![], - init_descriptors: vec![], - descriptors: vec![], - current_usage: wgpu::BufferUsages::UNIFORM, - } + Self::default() } pub fn set_usage(mut self, usage: wgpu::BufferUsages) -> Self { @@ -74,6 +69,17 @@ impl<'a> BulkBufferBuilder<'a> { } } +impl<'a> Default for BulkBufferBuilder<'a> { + fn default() -> Self { + Self { + order: vec![], + init_descriptors: vec![], + descriptors: vec![], + current_usage: wgpu::BufferUsages::UNIFORM, + } + } +} + pub trait BufferExt { fn get_mapped_range, T: bytemuck::Pod>( &self,