[][src]Struct web_glitz::rendering::MultisampleFramebuffer

pub struct MultisampleFramebuffer<C, Ds> {
    pub color: C,
    pub depth_stencil: Ds,
    // some fields omitted
}

Represents a set of image memory buffers that serve as the rendering destination for a [RenderPass].

The image buffers allocated in the framebuffer correspond to to the images attached to the [RenderTargetDescription] that was used to define the [RenderPass] (see also [RenderTarget]); specifically, [color] provides handles to the color buffers (if any), and [depth_stencil] provides a handle to the depth-stencil buffer (if any).

Fields

color: Cdepth_stencil: Ds

Methods from Deref<Target = GraphicsPipelineTarget>

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.

Trait Implementations

impl<C, Ds> Deref for MultisampleFramebuffer<C, Ds>[src]

type Target = GraphicsPipelineTarget

The resulting type after dereferencing.

Auto Trait Implementations

impl<C, Ds> !RefUnwindSafe for MultisampleFramebuffer<C, Ds>

impl<C, Ds> Send for MultisampleFramebuffer<C, Ds> where
    C: Send,
    Ds: Send

impl<C, Ds> !Sync for MultisampleFramebuffer<C, Ds>

impl<C, Ds> Unpin for MultisampleFramebuffer<C, Ds> where
    C: Unpin,
    Ds: Unpin

impl<C, Ds> UnwindSafe for MultisampleFramebuffer<C, Ds> where
    C: UnwindSafe,
    Ds: UnwindSafe

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.