diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index 1329d16ced9ab..befc255daf1c3 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -715,11 +715,18 @@ pub fn queue_mesh_bind_group( // ignoring the rest, whether they're valid for other dynamic offsets or not. This trick may // be supported later in encase, and then we should make use of it. -#[derive(Default)] pub struct SkinnedMeshUniform { pub buffer: BufferVec, } +impl Default for SkinnedMeshUniform { + fn default() -> Self { + Self { + buffer: BufferVec::new(BufferUsages::UNIFORM), + } + } +} + pub fn prepare_skinned_meshes( render_device: Res, render_queue: Res, diff --git a/crates/bevy_render/src/render_resource/buffer_vec.rs b/crates/bevy_render/src/render_resource/buffer_vec.rs index ad8f5ff2adfe1..6e2deb3009018 100644 --- a/crates/bevy_render/src/render_resource/buffer_vec.rs +++ b/crates/bevy_render/src/render_resource/buffer_vec.rs @@ -14,23 +14,14 @@ pub struct BufferVec { buffer_usage: BufferUsages, } -impl Default for BufferVec { - fn default() -> Self { +impl BufferVec { + pub const fn new(buffer_usage: BufferUsages) -> Self { Self { values: Vec::new(), buffer: None, capacity: 0, - buffer_usage: BufferUsages::all(), item_size: std::mem::size_of::(), - } - } -} - -impl BufferVec { - pub fn new(buffer_usage: BufferUsages) -> Self { - Self { buffer_usage, - ..Default::default() } }