pub struct Framebuffer<Rp, A> { /* private fields */ }
Expand description

Contains a render pass and the image views that are attached to it.

Creating a framebuffer is done by calling Framebuffer::start, which returns a FramebufferBuilder object. You can then add the framebuffer attachments one by one by calling add(image). When you are done, call build().

Both the add and the build functions perform various checks to make sure that the number of images is correct and that each image is compatible with the attachment definition in the render pass.

use vulkano::framebuffer::Framebuffer;

// let render_pass: Arc<_> = ...;
let framebuffer = Framebuffer::start(render_pass.clone())
    .add(my_image).unwrap()
    .build().unwrap();

Just like render pass objects implement the RenderPassAbstract trait, all framebuffer objects implement the FramebufferAbstract trait. This means that you can cast any Arc<Framebuffer<..>> into an Arc<FramebufferAbstract + Send + Sync> for easier storage.

Framebuffer dimensions

If you use Framebuffer::start() to create a framebuffer then vulkano will automatically make sure that all the attachments have the same dimensions, as this is the most common situation.

Alternatively you can also use with_intersecting_dimensions, in which case the dimensions of the framebuffer will be the intersection of the dimensions of all attachments, or with_dimensions if you want to specify exact dimensions. If you use with_dimensions, you are allowed to attach images that are larger than these dimensions.

If the dimensions of the framebuffer don’t match the dimensions of one of its attachment, then only the top-left hand corner of the image will be drawn to.

Implementations

Starts building a framebuffer.

Starts building a framebuffer. The dimensions of the framebuffer will automatically be the intersection of the dimensions of all the attachments.

Starts building a framebuffer.

Returns the width, height and layers of this framebuffer.

Returns the width of the framebuffer in pixels.

Returns the height of the framebuffer in pixels.

Returns the number of layers (or depth) of the framebuffer.

Returns the device that was used to create this framebuffer.

Returns the renderpass that was used to create this framebuffer.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the device that owns Self.
Executes the destructor for this type. Read more
Returns an opaque struct that represents the framebuffer’s internals.
Returns the width, height and array layers of the framebuffer.
Returns the attachment of the framebuffer with the given index. Read more
Returns the width of the framebuffer in pixels.
Returns the height of the framebuffer in pixels.
Returns the number of layers (or depth) of the framebuffer.
Returns an opaque object representing the render pass’ internals. Read more
Returns the number of attachments of the render pass.
Returns the description of an attachment. Read more
Returns the number of subpasses of the render pass.
Returns the description of a subpass. Read more
Returns the number of dependencies of the render pass.
Returns the description of a dependency. Read more
Returns an iterator to the list of attachments.
Returns an iterator to the list of subpasses.
Returns an iterator to the list of dependencies.
Returns true if this render pass is compatible with another render pass. Read more
Builds a render pass from this description. Read more
Returns the number of color attachments of a subpass. Returns None if out of range.
Returns the number of samples of the attachments of a subpass. Returns None if out of range or if the subpass has no attachment. TODO: return an enum instead? Read more
Returns a tuple whose first element is true if there’s a depth attachment, and whose second element is true if there’s a stencil attachment. Returns None if out of range. Read more
Returns true if a subpass has a depth attachment or a depth-stencil attachment.
Returns true if a subpass has a depth attachment or a depth-stencil attachment whose layout is not DepthStencilReadOnlyOptimal. Read more
Returns true if a subpass has a stencil attachment or a depth-stencil attachment.
Returns true if a subpass has a stencil attachment or a depth-stencil attachment whose layout is not DepthStencilReadOnlyOptimal. Read more
Decodes a C into a list of clear values where each element corresponds to an attachment. The size of the returned iterator must be the same as the number of attachments. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.