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 CmdDrawIndexedRaw {
index_count: u32,
instance_count: u32,
first_index: u32,
vertex_offset: i32,
first_instance: u32,
}
impl CmdDrawIndexedRaw {
#[inline]
pub unsafe fn new(index_count: u32, instance_count: u32, first_index: u32,
vertex_offset: i32, first_instance: u32) -> CmdDrawIndexedRaw
{
CmdDrawIndexedRaw {
index_count: index_count,
instance_count: instance_count,
first_index: first_index,
vertex_offset: vertex_offset,
first_instance: first_instance,
}
}
}
unsafe impl<'a, P> AddCommand<&'a CmdDrawIndexedRaw> for UnsafeCommandBufferBuilder<P>
where P: CommandPool
{
type Out = UnsafeCommandBufferBuilder<P>;
#[inline]
fn add(self, command: &'a CmdDrawIndexedRaw) -> Result<Self::Out, CommandAddError> {
unsafe {
let vk = self.device().pointers();
let cmd = self.internal_object();
vk.CmdDrawIndexed(cmd, command.index_count, command.instance_count,
command.first_index, command.vertex_offset, command.first_instance);
}
Ok(self)
}
}