Skip to content

Commit

Permalink
Minor clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
asny committed Jan 8, 2025
1 parent 531fdb4 commit 336e5fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/renderer/geometry/instanced_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ impl InstancedMesh {
/// The model is rendered in as many instances as there are attributes in [Instances] given as input.
///
pub fn new(context: &Context, instances: &Instances, cpu_mesh: &CpuMesh) -> Self {
#[cfg(debug_assertions)]
instances.validate().expect("invalid instances");

let aabb = cpu_mesh.compute_aabb();
let mut instanced_mesh = Self {
let instanced_mesh = Self {
context: context.clone(),
base_mesh: BaseMesh::new(context, cpu_mesh),
transform: RwLock::new((
Expand All @@ -52,7 +55,7 @@ impl InstancedMesh {
animation: None,
instances: instances.clone(),
};
instanced_mesh.set_instances(instances);
instanced_mesh.update_instance_buffers();
instanced_mesh
}

Expand Down

0 comments on commit 336e5fa

Please sign in to comment.