Fix passing a stride of 0 for draw_indirect

This commit is contained in:
Pierre Krieger 2017-06-23 15:15:12 +02:00
parent 5d9e298ec3
commit e9e86fcebc
2 changed files with 5 additions and 1 deletions

View File

@ -299,7 +299,8 @@ impl<P> AutoCommandBufferBuilder<P> {
descriptor_sets(&mut self.inner, true, pipeline.clone(), sets);
vertex_buffers(&mut self.inner, &pipeline, vertices);
self.inner.draw_indirect(indirect_buffer, draw_count, 0);
self.inner.draw_indirect(indirect_buffer, draw_count,
mem::size_of::<DrawIndirectCommand>() as u32);
Ok(self)
}
}

View File

@ -626,6 +626,9 @@ impl<P> UnsafeCommandBufferBuilder<P> {
{
let vk = self.device().pointers();
let cmd = self.internal_object();
debug_assert!(draw_count == 0 || ((stride % 4) == 0) &&
stride as usize >= mem::size_of::<vk::DrawIndirectCommand>());
let inner = buffer.inner();
debug_assert!(inner.offset < buffer.size());