Skip to content

Commit

Permalink
Actually hold mesh alive
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald committed Nov 15, 2021
1 parent 8a56ba2 commit a1960c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rend3/src/resources/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
util::{frustum::BoundingSphere, registry::ArchetypicalRegistry},
};
use glam::{Mat4, Vec3A};
use rend3_types::{Material, MaterialHandle, RawObjectHandle};
use rend3_types::{Material, MaterialHandle, MeshHandle, RawObjectHandle};

#[repr(C, align(16))]
#[derive(Debug, Copy, Clone)]
Expand All @@ -27,6 +27,7 @@ unsafe impl bytemuck::Zeroable for GPUCullingInput {}
#[repr(C, align(16))]
#[derive(Debug, Clone)]
pub struct InternalObject {
pub mesh_handle: MeshHandle,
pub material_handle: MaterialHandle,
// Index into the material archetype array
pub location: Vec3A,
Expand Down Expand Up @@ -78,6 +79,7 @@ impl ObjectManager {
vertex_offset: mesh.vertex_range.start as i32,
},
material_handle: object.material,
mesh_handle: object.mesh,
};

self.registry.insert(handle, shader_object, material_key);
Expand Down

0 comments on commit a1960c3

Please sign in to comment.