[][src]Struct web_glitz::rendering::GraphicsPipelineTarget

pub struct GraphicsPipelineTarget { /* fields omitted */ }

Implementations

impl GraphicsPipelineTarget[src]

pub fn pipeline_task<P, V, R, Tf, F, T>(
    &self,
    pipeline: &P,
    f: F
) -> PipelineTask<T> where
    P: GraphicsPipelineState<V, R, Tf>,
    F: Fn(ActiveGraphicsPipeline<'_, V, R, Tf>) -> T,
    T: GpuTask<PipelineTaskContext>, 
[src]

Creates a pipeline task using the given graphics_pipeline.

The second parameter f must be a function that returns the task that is to be executed while the graphics_pipeline is bound as the active graphics pipeline. This function will receive a reference to this ActiveGraphicsPipeline which may be used to encode draw commands (see [ActiveGraphicsPipeline::draw_command]). The task returned by the function typically consists of 1 ore more draw commands that were created in this way. The current framebuffer serves as the output target for the graphics_pipeline (your draw commands may modify the current framebuffer).

Example

let render_pass = render_target.create_render_pass(|framebuffer| {
    framebuffer.pipeline_task(&graphics_pipeline, |active_pipeline| {
        active_pipeline.task_builder()
            .bind_vertex_buffers(&vertex_buffer)
            .bind_resources(&resources)
            .draw(16, 1)
            .finish()
    })
});

In this example, context is a [RenderingContext]; render_target is a [RenderTarget], see also [DefaultRenderTarget] and [RenderTarget]; graphics_pipeline is a GraphicsPipeline, see GraphicsPipeline for details; vertex_buffer is a [Buffer] holding a [Vertex] type, see [Buffer], [Vertex] for details; resources is a resource [BindGroup], see [BindGroup] for details.

Panics

Panics if the graphics_pipeline belongs to a different context than the framebuffer for which this pipeline task is being created.

Panics if the task returned by f contains commands that were constructed for a different pipeline task context.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<D, T> IntoBuffer<T> for D where
    D: Borrow<T> + 'static,
    T: Copy + 'static, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.