mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-29 18:24:26 +00:00
Fix passing a stride of 0 for draw_indirect
This commit is contained in:
parent
5d9e298ec3
commit
e9e86fcebc
@ -299,7 +299,8 @@ impl<P> AutoCommandBufferBuilder<P> {
|
|||||||
descriptor_sets(&mut self.inner, true, pipeline.clone(), sets);
|
descriptor_sets(&mut self.inner, true, pipeline.clone(), sets);
|
||||||
vertex_buffers(&mut self.inner, &pipeline, vertices);
|
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)
|
Ok(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -627,6 +627,9 @@ impl<P> UnsafeCommandBufferBuilder<P> {
|
|||||||
let vk = self.device().pointers();
|
let vk = self.device().pointers();
|
||||||
let cmd = self.internal_object();
|
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();
|
let inner = buffer.inner();
|
||||||
debug_assert!(inner.offset < buffer.size());
|
debug_assert!(inner.offset < buffer.size());
|
||||||
debug_assert!(inner.buffer.usage_indirect_buffer());
|
debug_assert!(inner.buffer.usage_indirect_buffer());
|
||||||
|
Loading…
Reference in New Issue
Block a user