master
mitchellhansen 5 years ago
parent 83a5e9b997
commit a3ce819cd9

@ -443,11 +443,13 @@ impl CanvasState {
{ {
let g = hprof::enter("Textured Vertex Buffer"); let g = hprof::enter("Textured Vertex Buffer");
for (k, v) in textured_drawables.drain() { for (k, v) in textured_drawables.drain() {
let vertex_buffer = v.clone().iter() let vertex_buffer = v.clone().get(0).unwrap().clone();
.fold(Vec::new(), |mut a: Vec<RuntimeVertexDef>, b| { // TODO
a.extend(b); // v.clone().iter()
a // .fold(Vec::new(), |mut a: Vec<RuntimeVertexDef>, b| {
}); // a.extend(b);
// a
// });
self.textured_vertex_buffer.insert( self.textured_vertex_buffer.insert(
k.clone(), k.clone(),
@ -464,11 +466,13 @@ impl CanvasState {
{ {
let g = hprof::enter("Image Vertex Buffer"); let g = hprof::enter("Image Vertex Buffer");
for (k, v) in image_drawables.drain() { for (k, v) in image_drawables.drain() {
let vertex_buffer = v.clone().iter() let vertex_buffer = v.clone().get(0).unwrap().clone();
.fold(Vec::new(), |mut a: Vec<&RuntimeVertexDef>, b| { // TODO
a.extend(b); // v.clone().iter()
a // .fold(Vec::new(), |mut a: Vec<&RuntimeVertexDef>, b| {
}); // a.extend(b);
// a
// });
self.image_vertex_buffer.insert( self.image_vertex_buffer.insert(
k.clone(), k.clone(),

@ -131,6 +131,11 @@ unsafe impl<I> VertexDefinition<I> for RuntimeVertexDef
AttributeInfo { offset: 0, format: binding.format })); AttributeInfo { offset: 0, format: binding.format }));
} }
// let buffers = vec![
// (0, mem::size_of::<T>(), InputRate::Vertex),
// (1, mem::size_of::<U>(), InputRate::Instance),
// ].into_iter();
Ok((buffers_iter, attribs_iter.into_iter())) Ok((buffers_iter, attribs_iter.into_iter()))
} }
} }

Loading…
Cancel
Save