Framebuffer

Struct Framebuffer 

Source
pub struct Framebuffer { /* private fields */ }
Expand description

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 attachment within a render pass. Each attachment point in the render pass must have a matching image in the framebuffer.

use vulkano::render_pass::{Framebuffer, FramebufferCreateInfo};

// let render_pass: Arc<_> = ...;
let framebuffer = Framebuffer::new(
    render_pass.clone(),
    FramebufferCreateInfo {
        attachments: vec![view],
        ..Default::default()
    },
)
.unwrap();

Implementations§

Source§

impl Framebuffer

Source

pub fn new( render_pass: Arc<RenderPass>, create_info: FramebufferCreateInfo, ) -> Result<Arc<Framebuffer>, Validated<VulkanError>>

Creates a new Framebuffer.

Source

pub unsafe fn from_handle( render_pass: Arc<RenderPass>, handle: Framebuffer, create_info: FramebufferCreateInfo, ) -> Arc<Framebuffer>

Creates a new Framebuffer from a raw object handle.

§Safety
  • handle must be a valid Vulkan object handle created from render_pass.
  • create_info must match the info used to create the object.
Source

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

Returns the renderpass that was used to create this framebuffer.

Source

pub fn flags(&self) -> FramebufferCreateFlags

Returns the flags that the framebuffer was created with.

Source

pub fn attachments(&self) -> &[Arc<ImageView>]

Returns the attachments of the framebuffer.

Source

pub fn extent(&self) -> [u32; 2]

Returns the extent (width and height) of the framebuffer.

Source

pub fn layers(&self) -> u32

Returns the number of layers of the framebuffer.

Source

pub fn attached_layers_ranges(&self) -> SmallVec<[Range<u32>; 4]>

Returns the layer ranges for all attachments.

Trait Implementations§

Source§

impl Debug for Framebuffer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl DeviceOwned for Framebuffer

Source§

fn device(&self) -> &Arc<Device>

Returns the device that owns self.
Source§

impl Drop for Framebuffer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Hash for Framebuffer

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Framebuffer

Source§

fn eq(&self, other: &Framebuffer) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl VulkanObject for Framebuffer

Source§

type Handle = Framebuffer

The type of the object.
Source§

fn handle(&self) -> <Framebuffer as VulkanObject>::Handle

Returns the raw Vulkan handle of the object.
Source§

impl Eq for Framebuffer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeviceOwnedVulkanObject for T

Source§

fn set_debug_utils_object_name( &self, object_name: Option<&str>, ) -> Result<(), VulkanError>

Assigns a human-readable name to the object for debugging purposes. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.