Struct vulkano::render_pass::Framebuffer[][src]

pub struct Framebuffer<A> { /* fields omitted */ }

The image views that are attached to a render pass during drawing.

A framebuffer is a collection of images, and supplies the actual inputs and outputs of each subpass within a render pass. It is created from a subpass and must match it: each attachment point in the subpass must have a matching image in the framebuffer.

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::render_pass::Framebuffer;

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

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

impl Framebuffer<()>[src]

pub fn start(render_pass: Arc<RenderPass>) -> FramebufferBuilder<()>[src]

Starts building a framebuffer.

pub fn with_intersecting_dimensions(
    render_pass: Arc<RenderPass>
) -> FramebufferBuilder<()>
[src]

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

pub fn with_dimensions(
    render_pass: Arc<RenderPass>,
    dimensions: [u32; 3]
) -> FramebufferBuilder<()>
[src]

Starts building a framebuffer.

impl<A> Framebuffer<A>[src]

pub fn dimensions(&self) -> [u32; 3][src]

Returns the width, height and layers of this framebuffer.

pub fn width(&self) -> u32[src]

Returns the width of the framebuffer in pixels.

pub fn height(&self) -> u32[src]

Returns the height of the framebuffer in pixels.

pub fn layers(&self) -> u32[src]

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

pub fn device(&self) -> &Arc<Device>[src]

Returns the device that was used to create this framebuffer.

pub fn render_pass(&self) -> &Arc<RenderPass>[src]

Returns the renderpass that was used to create this framebuffer.

Trait Implementations

impl<A: Debug> Debug for Framebuffer<A>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<A> DeviceOwned for Framebuffer<A>[src]

fn device(&self) -> &Arc<Device>[src]

Returns the device that owns Self.

impl<A> Drop for Framebuffer<A>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl<A> FramebufferAbstract for Framebuffer<A> where
    A: AttachmentsList
[src]

fn inner(&self) -> FramebufferSys<'_>[src]

Returns an opaque struct that represents the framebuffer’s internals.

fn dimensions(&self) -> [u32; 3][src]

Returns the width, height and array layers of the framebuffer.

fn render_pass(&self) -> &Arc<RenderPass>[src]

Returns the render pass this framebuffer was created for.

fn attached_image_view(&self, index: usize) -> Option<&dyn ImageViewAbstract>[src]

Returns the attachment of the framebuffer with the given index. Read more

fn width(&self) -> u32[src]

Returns the width of the framebuffer in pixels.

fn height(&self) -> u32[src]

Returns the height of the framebuffer in pixels.

fn layers(&self) -> u32[src]

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

Auto Trait Implementations

impl<A> RefUnwindSafe for Framebuffer<A> where
    A: RefUnwindSafe

impl<A> Send for Framebuffer<A> where
    A: Send

impl<A> Sync for Framebuffer<A> where
    A: Sync

impl<A> Unpin for Framebuffer<A> where
    A: Unpin

impl<A> UnwindSafe for Framebuffer<A> where
    A: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Content for T[src]

pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>[src]

Builds a pointer to this type from a raw pointer.

pub fn is_size_suitable(usize) -> bool[src]

Returns true if the size is suitable to store a type like this.

pub fn indiv_size() -> usize[src]

Returns the size of an individual element.

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.