Skip to main content

RenderPassInterface

Trait RenderPassInterface 

Source
trait RenderPassInterface<'a> {
    // Required methods
    fn set_bind_group(&mut self, index: u32, bind_group: &'a BindGroup);
    fn set_vertex_buffer(
        &mut self,
        slot: u32,
        buffer: &'a Buffer,
        range: Range<u64>,
    );
    fn set_index_buffer(
        &mut self,
        buffer: &'a Buffer,
        range: Range<u64>,
        format: IndexFormat,
    );
    fn set_scissor_rect(&mut self, scissor: ScissorRect);
    fn set_viewport_rect(&mut self, viewport: ViewportRect);
    fn set_stencil_reference(&mut self, reference: u32);
    fn set_pipeline(&mut self, pipeline: &'a RenderPipeline);
    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

The render-pass operations PassState records through.

[wgpu::RenderPass] is the production implementation. Tests implement it with a mock that counts calls, so the state-reuse rules — a set_* whose target is already bound is skipped — can be checked without asking wgpu to expose its command stream.

Required Methods§

Source

fn set_bind_group(&mut self, index: u32, bind_group: &'a BindGroup)

Bind bind_group at index.

Source

fn set_vertex_buffer( &mut self, slot: u32, buffer: &'a Buffer, range: Range<u64>, )

Bind range of buffer at vertex-buffer slot.

Source

fn set_index_buffer( &mut self, buffer: &'a Buffer, range: Range<u64>, format: IndexFormat, )

Bind range of buffer as the index buffer.

Source

fn set_scissor_rect(&mut self, scissor: ScissorRect)

Set the scissor rectangle.

Source

fn set_viewport_rect(&mut self, viewport: ViewportRect)

Set the viewport.

Source

fn set_stencil_reference(&mut self, reference: u32)

Set the stencil reference.

Source

fn set_pipeline(&mut self, pipeline: &'a RenderPipeline)

Bind the pipeline the draws rasterize with.

Source

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

Draw a non-indexed range of vertices.

Source

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

Draw an indexed range of vertices.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, 'p> RenderPassInterface<'a> for RenderPass<'p>

Source§

fn set_bind_group(&mut self, index: u32, bind_group: &'a BindGroup)

Source§

fn set_vertex_buffer( &mut self, slot: u32, buffer: &'a Buffer, range: Range<u64>, )

Source§

fn set_index_buffer( &mut self, buffer: &'a Buffer, range: Range<u64>, format: IndexFormat, )

Source§

fn set_scissor_rect(&mut self, scissor: ScissorRect)

Source§

fn set_viewport_rect(&mut self, viewport: ViewportRect)

Source§

fn set_stencil_reference(&mut self, reference: u32)

Source§

fn set_pipeline(&mut self, pipeline: &'a RenderPipeline)

Source§

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

Source§

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

Implementors§