[][src]Struct web_glitz::rendering::RenderTarget

pub struct RenderTarget<C, Ds> { /* fields omitted */ }

Describes a target for rendering operations.

A RenderTarget is used to create RenderPass tasks, see below.

A render target consists of a collection of references to renderable images, from which image data may be loaded into Framebuffer memory, then modified by rendering commands as part of a RenderPass, and then the modified image data may be stored back into the images. These images are said to be "attached" to the render target and are referred to as its "attachments".

A RenderTarget may be initialized from a RenderTargetDescriptor with [RenderingContext::create_render_target] if the descriptor declares only a single color attachment, or with [RenderingContext::try_create_render_target] if the descriptor declares multiple color attachments, which may fail with an error if the number of color attachments exceeds [RenderingContext::max_color_attachments].

Note that the RenderTarget holds on to exclusive references to the images attached to it; this prevents you from accidentally also binding these images as pipeline resources within the RenderPass (attempting to read from an image while it is loaded in the framebuffer is undefined behavior).

RenderTargets are cheap to create (their creation does not involve any interaction with the GPU backend). You are encouraged to create ephemeral RenderTargets every time you want to define a RenderPass, rather than attempting to keep a RenderTarget alive (which is cumbersome as this will keep exclusive borrows to each of the attached images alive for the lifetime of the RenderTarget).

Creating a render pass

A new render pass can be created by calling [create_render_pass], passing it a function that takes a Framebuffer as its input and returns a render pass task:

use web_glitz::image::Region2D;
use web_glitz::image::format::RGBA8;
use web_glitz::image::renderbuffer::RenderbufferDescriptor;
use web_glitz::rendering::{LoadOp, StoreOp, RenderTargetDescriptor};

let mut color_image = context.create_renderbuffer(&RenderbufferDescriptor{
    format: RGBA8,
    width: 500,
    height: 500
});

let render_target_descriptor = RenderTargetDescriptor::new()
    .attach_color_float(&mut color_image, LoadOp::Load, StoreOp::Store);

//  Mark our render target as `mut`, as `create_render_pass` requires a `&mut` reference.
let mut render_target = context.create_render_target(render_target_descriptor);

let render_pass = render_target.create_render_pass(|framebuffer| {
    // Return a task that modifies the framebuffer, see the documentation for the
    // `Framebuffer` type for details. For this example, we'll clear the first (and only) color
    // attachment to "opaque red".
    framebuffer.color.0.clear_command([1.0, 0.0, 0.0, 1.0], Region2D::Fill)
});

Rendering output buffers will be allocated in the framebuffer for each of the color images attached to the render target (if any) and for the depth-stencil image attached to the render target (if any).

The function must return a GpuTask that can be executed in a RenderPassContext. This function will receive a reference to the framebuffer representation associated with the render target. It may use this reference to construct commands that make up that task, see Framebuffer for details.

At the start of the render pass, the LoadOps associated with each of the images attached to the render target will be performed to initialize the framebuffer. Then the task returned from the function is executed, which may modify the contents of the framebuffer. Finally, the StoreOps associated with each of the images attached to the render target will be performed to store the (modified) contents of the framebuffer back to these images.

Implementations

impl<C0> RenderTarget<(C0,), ()> where
    C0: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer,), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1> RenderTarget<(C0, C1), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2> RenderTarget<(C0, C1, C2), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3> RenderTarget<(C0, C1, C2, C3), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4> RenderTarget<(C0, C1, C2, C3, C4), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5> RenderTarget<(C0, C1, C2, C3, C4, C5), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6> RenderTarget<(C0, C1, C2, C3, C4, C5, C6), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer,
    C13: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer, C13::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer,
    C13: EncodeColorBuffer,
    C14: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer, C13::Buffer, C14::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15), ()> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer,
    C13: EncodeColorBuffer,
    C14: EncodeColorBuffer,
    C15: EncodeColorBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer, C13::Buffer, C14::Buffer, C15::Buffer), ()>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<Ds> RenderTarget<(), Ds> where
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, Ds> RenderTarget<(C0,), Ds> where
    C0: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer,), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, Ds> RenderTarget<(C0, C1), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, Ds> RenderTarget<(C0, C1, C2), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, Ds> RenderTarget<(C0, C1, C2, C3), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, Ds> RenderTarget<(C0, C1, C2, C3, C4), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer,
    C13: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer, C13::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer,
    C13: EncodeColorBuffer,
    C14: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer, C13::Buffer, C14::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

impl<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, Ds> RenderTarget<(C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15), Ds> where
    C0: EncodeColorBuffer,
    C1: EncodeColorBuffer,
    C2: EncodeColorBuffer,
    C3: EncodeColorBuffer,
    C4: EncodeColorBuffer,
    C5: EncodeColorBuffer,
    C6: EncodeColorBuffer,
    C7: EncodeColorBuffer,
    C8: EncodeColorBuffer,
    C9: EncodeColorBuffer,
    C10: EncodeColorBuffer,
    C11: EncodeColorBuffer,
    C12: EncodeColorBuffer,
    C13: EncodeColorBuffer,
    C14: EncodeColorBuffer,
    C15: EncodeColorBuffer,
    Ds: EncodeDepthStencilBuffer
[src]

pub fn create_render_pass<F, T>(&mut self, f: F) -> RenderPass<T> where
    F: FnOnce(&Framebuffer<(C0::Buffer, C1::Buffer, C2::Buffer, C3::Buffer, C4::Buffer, C5::Buffer, C6::Buffer, C7::Buffer, C8::Buffer, C9::Buffer, C10::Buffer, C11::Buffer, C12::Buffer, C13::Buffer, C14::Buffer, C15::Buffer), Ds::Buffer>) -> T,
    T: GpuTask<RenderPassContext>, 
[src]

Creates a new RenderPass that will output to this RenderTarget.

The f function will receive a reference to a Framebuffer with a buffer layout that matches the RenderTarget's attachment layout.

For details and examples on defining render passes, please refer to the struct documentation for RenderTarget.

Panics

Panics if the render pass context ID associated with the task returned from f does not match the ID generated for this render pass (the task returned from f must not contain commands that were created for a different render pass).

Trait Implementations

impl<C, Ds> Hash for RenderTarget<C, Ds>[src]

impl<C, Ds> PartialEq<RenderTarget<C, Ds>> for RenderTarget<C, Ds>[src]

Auto Trait Implementations

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

impl<C, Ds> !Send for RenderTarget<C, Ds>

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

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

impl<C, Ds> !UnwindSafe for RenderTarget<C, Ds>

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.