lots of refactoring for the dynamic vertex in addition to planning out documentation

This commit is contained in:
2020-01-22 18:38:45 -08:00
parent 8db858b29a
commit 83a5e9b997
25 changed files with 221 additions and 103 deletions

View File

@@ -6,6 +6,8 @@ use cgmath::num_traits::real::Real;
use std::vec::IntoIter as VecIntoIter;
/// Runtime Vertex def is just a generic holder of "dynamic vertex definitions"
// This baby needs to be able to be copied....
#[derive(Default, Debug, Clone)]
pub struct RuntimeVertexDef {
buffers: Vec<(u32, usize, InputRate)>, // (attribute id, stride, Vertex or Instance data)
vertex_buffer_ids: Vec<(usize, usize)>,//
@@ -25,6 +27,12 @@ impl RuntimeVertexDef {
let mut attributes = Vec::new();
let mut num_vertices = u32::max_value();
// https://github.com/KhronosGroup/glTF-Sample-Models/blob/master/2.0/Box/glTF/Box.gltf
// https://github.com/tomaka/vulkano-examples/blob/gltf/gltf/gltf_system.rs
// for (attribute_id, attribute) in primitive.attributes().enumerate() {
// let (name, accessor) = match attribute.clone() {
@@ -56,7 +64,10 @@ impl RuntimeVertexDef {
// };
//
// let view = accessor.view();
// buffers.push((attribute_id as u32, view.stride().unwrap_or(accessor.size()), InputRate::Vertex));
// buffers.push((attribute_id as u32,
// view.stride().unwrap_or(accessor.size()),
// InputRate::Vertex
// ));
// attributes.push((name, attribute_id as u32, infos));
// vertex_buffer_ids.push((view.buffer().index(), view.offset() + accessor.offset()));
// }