use command_buffer::CommandAddError;
use command_buffer::cb::AddCommand;
use command_buffer::cb::UnsafeCommandBufferBuilder;
use command_buffer::pool::CommandPool;
use device::DeviceOwned;
use VulkanObject;
use VulkanPointers;
pub struct CmdDrawRaw {
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
first_instance: u32,
}
impl CmdDrawRaw {
#[inline]
pub unsafe fn new(vertex_count: u32, instance_count: u32, first_vertex: u32,
first_instance: u32) -> CmdDrawRaw
{
CmdDrawRaw {
vertex_count: vertex_count,
instance_count: instance_count,
first_vertex: first_vertex,
first_instance: first_instance,
}
}
}
unsafe impl<'a, P> AddCommand<&'a CmdDrawRaw> for UnsafeCommandBufferBuilder<P>
where P: CommandPool
{
type Out = UnsafeCommandBufferBuilder<P>;
#[inline]
fn add(self, command: &'a CmdDrawRaw) -> Result<Self::Out, CommandAddError> {
unsafe {
let vk = self.device().pointers();
let cmd = self.internal_object();
vk.CmdDraw(cmd, command.vertex_count, command.instance_count, command.first_vertex,
command.first_instance);
}
Ok(self)
}
}