Trait RenderPass

Source
pub trait RenderPass<'pass> {
    // Required methods
    fn set_pipeline(&mut self, pipeline: &'pass RenderPipelineId);
    fn set_vertex_buffer(
        &mut self,
        slot: u32,
        buffer: &'pass BufferId,
        offset: u64,
    );
    fn set_index_buffer(
        &mut self,
        buffer: &'pass BufferId,
        offset: u64,
        index_format: IndexFormat,
    );
    fn draw(&mut self, vertices: Range<u32>, instances: Range<u32>);
    fn draw_indexed(
        &mut self,
        indices: Range<u32>,
        base_vertex: i32,
        instances: Range<u32>,
    );
}
Expand description

A trait representing an active render pass, used for recording drawing commands.

A RenderPass object is obtained from a CommandEncoder and provides methods to set pipeline state (e.g., pipeline, vertex/index buffers) and issue draw calls.

The 'pass lifetime ensures that the pass object cannot outlive the CommandEncoder that created it, and that any resources bound to it (like buffers) also live long enough.

Required Methods§

Source

fn set_pipeline(&mut self, pipeline: &'pass RenderPipelineId)

Sets the active render pipeline for subsequent draw calls.

Source

fn set_vertex_buffer(&mut self, slot: u32, buffer: &'pass BufferId, offset: u64)

Binds a vertex buffer to a specific slot.

Source

fn set_index_buffer( &mut self, buffer: &'pass BufferId, offset: u64, index_format: IndexFormat, )

Binds an index buffer for indexed drawing.

Source

fn draw(&mut self, vertices: Range<u32>, instances: Range<u32>)

Records a non-indexed draw call.

Source

fn draw_indexed( &mut self, indices: Range<u32>, base_vertex: i32, instances: Range<u32>, )

Records an indexed draw call.

Implementors§