master
mitchellhansen 5 years ago
parent 83a5e9b997
commit a3ce819cd9

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

@ -131,6 +131,11 @@ unsafe impl<I> VertexDefinition<I> for RuntimeVertexDef
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()))
}
}

Loading…
Cancel
Save