[−][src]Struct vulkano::framebuffer::Framebuffer
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
impl<Rp> Framebuffer<Rp, ()>
[src]
pub fn start(render_pass: Rp) -> FramebufferBuilder<Rp, ()>
[src]
Starts building a framebuffer.
pub fn with_intersecting_dimensions(
render_pass: Rp
) -> FramebufferBuilder<Rp, ()>
[src]
render_pass: Rp
) -> FramebufferBuilder<Rp, ()>
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: Rp,
dimensions: [u32; 3]
) -> FramebufferBuilder<Rp, ()>
[src]
render_pass: Rp,
dimensions: [u32; 3]
) -> FramebufferBuilder<Rp, ()>
Starts building a framebuffer.
impl<Rp, A> Framebuffer<Rp, 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) -> &Rp
[src]
Returns the renderpass that was used to create this framebuffer.
Trait Implementations
impl<Rp: Debug, A: Debug> Debug for Framebuffer<Rp, A>
[src]
impl<Rp, A> DeviceOwned for Framebuffer<Rp, A>
[src]
impl<Rp, A> Drop for Framebuffer<Rp, A>
[src]
impl<Rp, A> FramebufferAbstract for Framebuffer<Rp, A> where
Rp: RenderPassAbstract,
A: AttachmentsList,
[src]
Rp: RenderPassAbstract,
A: AttachmentsList,
pub fn inner(&self) -> FramebufferSys<'_>
[src]
pub fn dimensions(&self) -> [u32; 3]
[src]
pub fn attached_image_view(&self, index: usize) -> Option<&dyn ImageViewAccess>
[src]
pub fn width(&self) -> u32
[src]
pub fn height(&self) -> u32
[src]
pub fn layers(&self) -> u32
[src]
impl<Rp, A> RenderPassAbstract for Framebuffer<Rp, A> where
Rp: RenderPassAbstract,
[src]
Rp: RenderPassAbstract,
pub fn inner(&self) -> RenderPassSys<'_>
[src]
impl<Rp, A> RenderPassDesc for Framebuffer<Rp, A> where
Rp: RenderPassDesc,
[src]
Rp: RenderPassDesc,
pub fn num_attachments(&self) -> usize
[src]
pub fn attachment_desc(&self, num: usize) -> Option<AttachmentDescription>
[src]
pub fn num_subpasses(&self) -> usize
[src]
pub fn subpass_desc(&self, num: usize) -> Option<PassDescription>
[src]
pub fn num_dependencies(&self) -> usize
[src]
pub fn dependency_desc(&self, num: usize) -> Option<PassDependencyDescription>
[src]
pub fn attachment_descs(&self) -> RenderPassDescAttachments<'_, Self>ⓘNotable traits for RenderPassDescAttachments<'a, R>
impl<'a, R: ?Sized + 'a> Iterator for RenderPassDescAttachments<'a, R> where
R: RenderPassDesc, type Item = AttachmentDescription;
where
Self: Sized,
[src]
Notable traits for RenderPassDescAttachments<'a, R>
impl<'a, R: ?Sized + 'a> Iterator for RenderPassDescAttachments<'a, R> where
R: RenderPassDesc, type Item = AttachmentDescription;
Self: Sized,
pub fn subpass_descs(&self) -> RenderPassDescSubpasses<'_, Self>ⓘNotable traits for RenderPassDescSubpasses<'a, R>
impl<'a, R: ?Sized + 'a> Iterator for RenderPassDescSubpasses<'a, R> where
R: RenderPassDesc, type Item = PassDescription;
where
Self: Sized,
[src]
Notable traits for RenderPassDescSubpasses<'a, R>
impl<'a, R: ?Sized + 'a> Iterator for RenderPassDescSubpasses<'a, R> where
R: RenderPassDesc, type Item = PassDescription;
Self: Sized,
pub fn dependency_descs(&self) -> RenderPassDescDependencies<'_, Self>ⓘNotable traits for RenderPassDescDependencies<'a, R>
impl<'a, R: ?Sized + 'a> Iterator for RenderPassDescDependencies<'a, R> where
R: RenderPassDesc, type Item = PassDependencyDescription;
where
Self: Sized,
[src]
Notable traits for RenderPassDescDependencies<'a, R>
impl<'a, R: ?Sized + 'a> Iterator for RenderPassDescDependencies<'a, R> where
R: RenderPassDesc, type Item = PassDependencyDescription;
Self: Sized,
pub fn is_compatible_with<T: ?Sized>(&self, other: &T) -> bool where
Self: Sized,
T: RenderPassDesc,
[src]
Self: Sized,
T: RenderPassDesc,
pub fn build_render_pass(
self,
device: Arc<Device>
) -> Result<RenderPass<Self>, RenderPassCreationError> where
Self: Sized,
[src]
self,
device: Arc<Device>
) -> Result<RenderPass<Self>, RenderPassCreationError> where
Self: Sized,
pub fn num_color_attachments(&self, subpass: u32) -> Option<u32>
[src]
pub fn num_samples(&self, subpass: u32) -> Option<u32>
[src]
pub fn has_depth_stencil_attachment(&self, subpass: u32) -> Option<(bool, bool)>
[src]
pub fn has_depth(&self, subpass: u32) -> Option<bool>
[src]
pub fn has_writable_depth(&self, subpass: u32) -> Option<bool>
[src]
pub fn has_stencil(&self, subpass: u32) -> Option<bool>
[src]
pub fn has_writable_stencil(&self, subpass: u32) -> Option<bool>
[src]
impl<C, Rp, A> RenderPassDescClearValues<C> for Framebuffer<Rp, A> where
Rp: RenderPassDescClearValues<C>,
[src]
Rp: RenderPassDescClearValues<C>,
pub fn convert_clear_values(
&self,
vals: C
) -> Box<dyn Iterator<Item = ClearValue>>
[src]
&self,
vals: C
) -> Box<dyn Iterator<Item = ClearValue>>
Auto Trait Implementations
impl<Rp, A> RefUnwindSafe for Framebuffer<Rp, A> where
A: RefUnwindSafe,
Rp: RefUnwindSafe,
[src]
A: RefUnwindSafe,
Rp: RefUnwindSafe,
impl<Rp, A> Send for Framebuffer<Rp, A> where
A: Send,
Rp: Send,
[src]
A: Send,
Rp: Send,
impl<Rp, A> Sync for Framebuffer<Rp, A> where
A: Sync,
Rp: Sync,
[src]
A: Sync,
Rp: Sync,
impl<Rp, A> Unpin for Framebuffer<Rp, A> where
A: Unpin,
Rp: Unpin,
[src]
A: Unpin,
Rp: Unpin,
impl<Rp, A> UnwindSafe for Framebuffer<Rp, A> where
A: UnwindSafe,
Rp: UnwindSafe,
[src]
A: UnwindSafe,
Rp: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Content for T
[src]
pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
pub fn is_size_suitable(usize) -> bool
[src]
pub fn indiv_size() -> usize
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,