add start and length to mesh parts

This commit is contained in:
Matthew 2025-11-22 15:25:40 +11:00
parent e6d66ee5ab
commit 4d54444fa1

View File

@ -82,7 +82,6 @@ struct Material
{ {
u32 pipeline_id; u32 pipeline_id;
MaterialMap[MMI.max] maps; MaterialMap[MMI.max] maps;
Vec4 params;
} }
struct Vertex struct Vertex
@ -98,6 +97,8 @@ struct Mesh
{ {
Vertex[] vtx; Vertex[] vtx;
u32[] idx; u32[] idx;
u64 start;
u64 length;
u32 mat_id; u32 mat_id;
} }
@ -724,6 +725,8 @@ AddMeshVertices(cgltf_accessor* accessor, Model* model, u64 mesh_index, u64* vtx
if(model.meshes[mesh_index].vtx == null) if(model.meshes[mesh_index].vtx == null)
{ {
model.meshes[mesh_index].vtx = model.vtx_buf[*vtx_count .. *vtx_count+accessor.count]; model.meshes[mesh_index].vtx = model.vtx_buf[*vtx_count .. *vtx_count+accessor.count];
model.meshes[mesh_index].start = *vtx_count;
model.meshes[mesh_index].length = accessor.count;
*vtx_count += accessor.count; *vtx_count += accessor.count;
} }
} }