Struct vulkano::framebuffer::Framebuffer [−][src]
pub struct Framebuffer<Rp, A> { /* fields omitted */ }
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.
Methods
impl<Rp> Framebuffer<Rp, ()>
[src]
impl<Rp> Framebuffer<Rp, ()>
pub fn start(render_pass: Rp) -> FramebufferBuilder<Rp, ()>
[src]
pub fn start(render_pass: Rp) -> FramebufferBuilder<Rp, ()>
Starts building a framebuffer.
pub fn with_intersecting_dimensions(
render_pass: Rp
) -> FramebufferBuilder<Rp, ()>
[src]
pub fn with_intersecting_dimensions(
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]
pub fn with_dimensions(
render_pass: Rp,
dimensions: [u32; 3]
) -> FramebufferBuilder<Rp, ()>
Starts building a framebuffer.
impl<Rp, A> Framebuffer<Rp, A>
[src]
impl<Rp, A> Framebuffer<Rp, A>
pub fn dimensions(&self) -> [u32; 3]
[src]
pub fn dimensions(&self) -> [u32; 3]
Returns the width, height and layers of this framebuffer.
pub fn width(&self) -> u32
[src]
pub fn width(&self) -> u32
Returns the width of the framebuffer in pixels.
pub fn height(&self) -> u32
[src]
pub fn height(&self) -> u32
Returns the height of the framebuffer in pixels.
pub fn layers(&self) -> u32
[src]
pub fn layers(&self) -> u32
Returns the number of layers (or depth) of the framebuffer.
pub fn device(&self) -> &Arc<Device>
[src]
pub fn device(&self) -> &Arc<Device>
Returns the device that was used to create this framebuffer.
pub fn render_pass(&self) -> &Rp
[src]
pub fn render_pass(&self) -> &Rp
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: Debug, A: Debug> Debug for Framebuffer<Rp, A>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<Rp, A> FramebufferAbstract for Framebuffer<Rp, A> where
Rp: RenderPassAbstract,
A: AttachmentsList,
[src]
impl<Rp, A> FramebufferAbstract for Framebuffer<Rp, A> where
Rp: RenderPassAbstract,
A: AttachmentsList,
fn inner(&self) -> FramebufferSys
[src]
fn inner(&self) -> FramebufferSys
Returns an opaque struct that represents the framebuffer's internals.
fn dimensions(&self) -> [u32; 3]
[src]
fn dimensions(&self) -> [u32; 3]
Returns the width, height and array layers of the framebuffer.
fn attached_image_view(&self, index: usize) -> Option<&ImageViewAccess>
[src]
fn attached_image_view(&self, index: usize) -> Option<&ImageViewAccess>
Returns the attachment of the framebuffer with the given index. Read more
fn width(&self) -> u32
[src]
fn width(&self) -> u32
Returns the width of the framebuffer in pixels.
fn height(&self) -> u32
[src]
fn height(&self) -> u32
Returns the height of the framebuffer in pixels.
fn layers(&self) -> u32
[src]
fn layers(&self) -> u32
Returns the number of layers (or depth) of the framebuffer.
impl<Rp, A> RenderPassDesc for Framebuffer<Rp, A> where
Rp: RenderPassDesc,
[src]
impl<Rp, A> RenderPassDesc for Framebuffer<Rp, A> where
Rp: RenderPassDesc,
fn num_attachments(&self) -> usize
[src]
fn num_attachments(&self) -> usize
Returns the number of attachments of the render pass.
fn attachment_desc(&self, num: usize) -> Option<LayoutAttachmentDescription>
[src]
fn attachment_desc(&self, num: usize) -> Option<LayoutAttachmentDescription>
Returns the description of an attachment. Read more
fn num_subpasses(&self) -> usize
[src]
fn num_subpasses(&self) -> usize
Returns the number of subpasses of the render pass.
fn subpass_desc(&self, num: usize) -> Option<LayoutPassDescription>
[src]
fn subpass_desc(&self, num: usize) -> Option<LayoutPassDescription>
Returns the description of a subpass. Read more
fn num_dependencies(&self) -> usize
[src]
fn num_dependencies(&self) -> usize
Returns the number of dependencies of the render pass.
fn dependency_desc(&self, num: usize) -> Option<LayoutPassDependencyDescription>
[src]
fn dependency_desc(&self, num: usize) -> Option<LayoutPassDependencyDescription>
Returns the description of a dependency. Read more
ⓘImportant traits for RenderPassDescAttachments<'a, R>fn attachment_descs(&self) -> RenderPassDescAttachments<Self> where
Self: Sized,
[src]
fn attachment_descs(&self) -> RenderPassDescAttachments<Self> where
Self: Sized,
Returns an iterator to the list of attachments.
ⓘImportant traits for RenderPassDescSubpasses<'a, R>fn subpass_descs(&self) -> RenderPassDescSubpasses<Self> where
Self: Sized,
[src]
fn subpass_descs(&self) -> RenderPassDescSubpasses<Self> where
Self: Sized,
Returns an iterator to the list of subpasses.
ⓘImportant traits for RenderPassDescDependencies<'a, R>fn dependency_descs(&self) -> RenderPassDescDependencies<Self> where
Self: Sized,
[src]
fn dependency_descs(&self) -> RenderPassDescDependencies<Self> where
Self: Sized,
Returns an iterator to the list of dependencies.
fn is_compatible_with<T: ?Sized>(&self, other: &T) -> bool where
Self: Sized,
T: RenderPassDesc,
[src]
fn is_compatible_with<T: ?Sized>(&self, other: &T) -> bool where
Self: Sized,
T: RenderPassDesc,
Returns true if this render pass is compatible with another render pass. Read more
fn build_render_pass(
self,
device: Arc<Device>
) -> Result<RenderPass<Self>, RenderPassCreationError> where
Self: Sized,
[src]
fn build_render_pass(
self,
device: Arc<Device>
) -> Result<RenderPass<Self>, RenderPassCreationError> where
Self: Sized,
Builds a render pass from this description. Read more
fn num_color_attachments(&self, subpass: u32) -> Option<u32>
[src]
fn num_color_attachments(&self, subpass: u32) -> Option<u32>
Returns the number of color attachments of a subpass. Returns None
if out of range.
fn num_samples(&self, subpass: u32) -> Option<u32>
[src]
fn num_samples(&self, subpass: u32) -> Option<u32>
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
fn has_depth_stencil_attachment(&self, subpass: u32) -> Option<(bool, bool)>
[src]
fn has_depth_stencil_attachment(&self, subpass: u32) -> Option<(bool, bool)>
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
fn has_depth(&self, subpass: u32) -> Option<bool>
[src]
fn has_depth(&self, subpass: u32) -> Option<bool>
Returns true if a subpass has a depth attachment or a depth-stencil attachment.
fn has_writable_depth(&self, subpass: u32) -> Option<bool>
[src]
fn has_writable_depth(&self, subpass: u32) -> Option<bool>
Returns true if a subpass has a depth attachment or a depth-stencil attachment whose layout is not DepthStencilReadOnlyOptimal
. Read more
fn has_stencil(&self, subpass: u32) -> Option<bool>
[src]
fn has_stencil(&self, subpass: u32) -> Option<bool>
Returns true if a subpass has a stencil attachment or a depth-stencil attachment.
fn has_writable_stencil(&self, subpass: u32) -> Option<bool>
[src]
fn has_writable_stencil(&self, subpass: u32) -> Option<bool>
Returns true if a subpass has a stencil attachment or a depth-stencil attachment whose layout is not DepthStencilReadOnlyOptimal
. Read more
impl<C, Rp, A> RenderPassDescClearValues<C> for Framebuffer<Rp, A> where
Rp: RenderPassDescClearValues<C>,
[src]
impl<C, Rp, A> RenderPassDescClearValues<C> for Framebuffer<Rp, A> where
Rp: RenderPassDescClearValues<C>,
fn convert_clear_values(&self, vals: C) -> Box<Iterator<Item = ClearValue>>
[src]
fn convert_clear_values(&self, vals: C) -> Box<Iterator<Item = ClearValue>>
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
impl<Rp, A> RenderPassAbstract for Framebuffer<Rp, A> where
Rp: RenderPassAbstract,
[src]
impl<Rp, A> RenderPassAbstract for Framebuffer<Rp, A> where
Rp: RenderPassAbstract,
fn inner(&self) -> RenderPassSys
[src]
fn inner(&self) -> RenderPassSys
Returns an opaque object representing the render pass' internals. Read more
impl<Rp, A> DeviceOwned for Framebuffer<Rp, A>
[src]
impl<Rp, A> DeviceOwned for Framebuffer<Rp, A>
impl<Rp, A> Drop for Framebuffer<Rp, A>
[src]
impl<Rp, A> Drop for Framebuffer<Rp, A>
Auto Trait Implementations
impl<Rp, A> Send for Framebuffer<Rp, A> where
A: Send,
Rp: Send,
impl<Rp, A> Send for Framebuffer<Rp, A> where
A: Send,
Rp: Send,
impl<Rp, A> Sync for Framebuffer<Rp, A> where
A: Sync,
Rp: Sync,
impl<Rp, A> Sync for Framebuffer<Rp, A> where
A: Sync,
Rp: Sync,