pub struct CommandBuffer { /* private fields */ }Expand description
Used to send instructions to the GPU.
Implementations§
Source§impl CommandBuffer
impl CommandBuffer
Sourcepub fn record<F: FnOnce()>(
&self,
flags: CommandBufferUsageFlags,
f: F,
) -> Result<(), Error>
pub fn record<F: FnOnce()>( &self, flags: CommandBufferUsageFlags, f: F, ) -> Result<(), Error>
Sourcepub fn begin(&self, flags: CommandBufferUsageFlags) -> Result<(), Error>
pub fn begin(&self, flags: CommandBufferUsageFlags) -> Result<(), Error>
Begin recording instructions to this command buffer.
§Examples
cmd_buffer.begin(plate::CommandBufferUsageFlags::empty())?;
// cmd_buffer.draw(..);Sourcepub fn end(&self) -> Result<(), Error>
pub fn end(&self) -> Result<(), Error>
Stop recording instructions to this command buffer.
§Examples
// cmd_buffer.draw(..);
cmd_buffer.end()?;Sourcepub fn draw(
&self,
vert_count: u32,
instance_count: u32,
first_vert: u32,
first_instance: u32,
)
pub fn draw( &self, vert_count: u32, instance_count: u32, first_vert: u32, first_instance: u32, )
Sourcepub fn draw_indexed(
&self,
index_count: u32,
instance_count: u32,
first_index: u32,
vertex_offset: i32,
first_instance: u32,
)
pub fn draw_indexed( &self, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, )
Calls a draw_indexed command.
To be used when recording a CommandBuffer.
§Examples
cmd_buffer.record(plate::CommandBufferUsageFlags::empty(), || {
cmd_buffer.draw_indexed(3, 1, 0, 0, 0);
})?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandBuffer
impl RefUnwindSafe for CommandBuffer
impl Send for CommandBuffer
impl Sync for CommandBuffer
impl Unpin for CommandBuffer
impl UnsafeUnpin for CommandBuffer
impl UnwindSafe for CommandBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more