Add Default impl for BulkBuferBuilder

This commit is contained in:
Jarrod Doyle 2024-04-26 21:21:02 +01:00
parent 8c1383792b
commit b848b78e86
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 12 additions and 6 deletions

View File

@ -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<S: RangeBounds<wgpu::BufferAddress>, T: bytemuck::Pod>(
&self,