ErasedDrawablePipeline

Trait ErasedDrawablePipeline 

Source
pub trait ErasedDrawablePipeline {
    // Required methods
    fn begin_frame(&mut self, context: &FrameContext<'_>);
    fn end_frame(&mut self, context: &FrameContext<'_>);
    fn begin_pass(&mut self, context: &mut PassContext<'_, '_>);
    fn end_pass(&mut self, context: &mut PassContext<'_, '_>);
    fn draw_erased(
        &mut self,
        device: &Device,
        queue: &Queue,
        config: &SurfaceConfiguration,
        render_pass: &mut RenderPass<'_>,
        commands: &[(&dyn DrawCommand, PxSize, PxPosition)],
        scene_texture_view: &TextureView,
        clip_rect: Option<PxRect>,
    ) -> bool;
}
Expand description

Internal trait for type erasure of drawable pipelines.

This trait enables dynamic dispatch of draw commands to their corresponding pipelines without knowing the specific command type at compile time. It’s used internally by the PipelineRegistry and should not be implemented directly by users.

The type erasure is achieved through the [AsAny] trait, which allows downcasting from &dyn DrawCommand to concrete command types.

§Implementation Note

This trait is automatically implemented for any type that implements DrawablePipeline<T> through the [DrawablePipelineImpl] wrapper.

Required Methods§

Source

fn begin_frame(&mut self, context: &FrameContext<'_>)

Source

fn end_frame(&mut self, context: &FrameContext<'_>)

Source

fn begin_pass(&mut self, context: &mut PassContext<'_, '_>)

Source

fn end_pass(&mut self, context: &mut PassContext<'_, '_>)

Source

fn draw_erased( &mut self, device: &Device, queue: &Queue, config: &SurfaceConfiguration, render_pass: &mut RenderPass<'_>, commands: &[(&dyn DrawCommand, PxSize, PxPosition)], scene_texture_view: &TextureView, clip_rect: Option<PxRect>, ) -> bool

Implementors§