Struct vulkano::framebuffer::RenderPass
source · pub struct RenderPass<D> { /* private fields */ }
Expand description
Defines the layout of multiple subpasses.
The RenderPass
struct should always implement the RenderPassAbstract
trait. Therefore
you can turn any Arc<RenderPass<D>>
into a Arc<RenderPassAbstract + Send + Sync>
if you need to.
Implementations
sourceimpl<D> RenderPass<D>where
D: RenderPassDesc,
impl<D> RenderPass<D>where
D: RenderPassDesc,
sourcepub fn new(
device: Arc<Device>,
description: D
) -> Result<RenderPass<D>, RenderPassCreationError>
pub fn new(
device: Arc<Device>,
description: D
) -> Result<RenderPass<D>, RenderPassCreationError>
Builds a new render pass.
Panic
- Can panic if it detects some violations in the restrictions. Only inexpensive checks are
performed.
debug_assert!
is used, so some restrictions are only checked in debug mode.
sourceimpl RenderPass<EmptySinglePassRenderPassDesc>
impl RenderPass<EmptySinglePassRenderPassDesc>
sourcepub fn empty_single_pass(
device: Arc<Device>
) -> Result<RenderPass<EmptySinglePassRenderPassDesc>, RenderPassCreationError>
pub fn empty_single_pass(
device: Arc<Device>
) -> Result<RenderPass<EmptySinglePassRenderPassDesc>, RenderPassCreationError>
Builds a render pass with one subpass and no attachment.
This method is useful for quick tests.
sourceimpl<D> RenderPass<D>
impl<D> RenderPass<D>
sourcepub fn granularity(&self) -> [u32; 2]
pub fn granularity(&self) -> [u32; 2]
Returns the granularity of this render pass.
If the render area of a render pass in a command buffer is a multiple of this granularity, then the performance will be optimal. Performances are always optimal for render areas that cover the whole framebuffer.
Trait Implementations
sourceimpl<D> Debug for RenderPass<D>where
D: Debug,
impl<D> Debug for RenderPass<D>where
D: Debug,
sourceimpl<D> DeviceOwned for RenderPass<D>
impl<D> DeviceOwned for RenderPass<D>
sourceimpl<D> Drop for RenderPass<D>
impl<D> Drop for RenderPass<D>
sourceimpl<D> RenderPassAbstract for RenderPass<D>where
D: RenderPassDesc,
impl<D> RenderPassAbstract for RenderPass<D>where
D: RenderPassDesc,
sourcefn inner(&self) -> RenderPassSys<'_>
fn inner(&self) -> RenderPassSys<'_>
Returns an opaque object representing the render pass’ internals. Read more
sourceimpl<D> RenderPassDesc for RenderPass<D>where
D: RenderPassDesc,
impl<D> RenderPassDesc for RenderPass<D>where
D: RenderPassDesc,
sourcefn num_attachments(&self) -> usize
fn num_attachments(&self) -> usize
Returns the number of attachments of the render pass.
sourcefn attachment_desc(&self, num: usize) -> Option<AttachmentDescription>
fn attachment_desc(&self, num: usize) -> Option<AttachmentDescription>
Returns the description of an attachment. Read more
sourcefn num_subpasses(&self) -> usize
fn num_subpasses(&self) -> usize
Returns the number of subpasses of the render pass.
sourcefn subpass_desc(&self, num: usize) -> Option<PassDescription>
fn subpass_desc(&self, num: usize) -> Option<PassDescription>
Returns the description of a subpass. Read more
sourcefn num_dependencies(&self) -> usize
fn num_dependencies(&self) -> usize
Returns the number of dependencies of the render pass.
sourcefn dependency_desc(&self, num: usize) -> Option<PassDependencyDescription>
fn dependency_desc(&self, num: usize) -> Option<PassDependencyDescription>
Returns the description of a dependency. Read more
sourcefn attachment_descs(&self) -> RenderPassDescAttachments<'_, Self> ⓘwhere
Self: Sized,
fn attachment_descs(&self) -> RenderPassDescAttachments<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator to the list of attachments.
sourcefn subpass_descs(&self) -> RenderPassDescSubpasses<'_, Self> ⓘwhere
Self: Sized,
fn subpass_descs(&self) -> RenderPassDescSubpasses<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator to the list of subpasses.
sourcefn dependency_descs(&self) -> RenderPassDescDependencies<'_, Self> ⓘwhere
Self: Sized,
fn dependency_descs(&self) -> RenderPassDescDependencies<'_, Self> ⓘwhere
Self: Sized,
Returns an iterator to the list of dependencies.
sourcefn is_compatible_with<T>(&self, other: &T) -> boolwhere
Self: Sized,
T: ?Sized + RenderPassDesc,
fn is_compatible_with<T>(&self, other: &T) -> boolwhere
Self: Sized,
T: ?Sized + RenderPassDesc,
Returns true if this render pass is compatible with another render pass. Read more
sourcefn build_render_pass(
self,
device: Arc<Device>
) -> Result<RenderPass<Self>, RenderPassCreationError>where
Self: Sized,
fn build_render_pass(
self,
device: Arc<Device>
) -> Result<RenderPass<Self>, RenderPassCreationError>where
Self: Sized,
Builds a render pass from this description. Read more
sourcefn num_color_attachments(&self, subpass: u32) -> Option<u32>
fn num_color_attachments(&self, subpass: u32) -> Option<u32>
Returns the number of color attachments of a subpass. Returns
None
if out of range.sourcefn num_samples(&self, subpass: u32) -> Option<u32>
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 moresourcefn has_depth_stencil_attachment(&self, subpass: u32) -> Option<(bool, bool)>
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 moresourcefn has_depth(&self, subpass: u32) -> Option<bool>
fn has_depth(&self, subpass: u32) -> Option<bool>
Returns true if a subpass has a depth attachment or a depth-stencil attachment.
sourcefn has_writable_depth(&self, subpass: u32) -> Option<bool>
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 moresourcefn has_stencil(&self, subpass: u32) -> Option<bool>
fn has_stencil(&self, subpass: u32) -> Option<bool>
Returns true if a subpass has a stencil attachment or a depth-stencil attachment.
sourceimpl<C, D> RenderPassDescClearValues<C> for RenderPass<D>where
D: RenderPassDescClearValues<C>,
impl<C, D> RenderPassDescClearValues<C> for RenderPass<D>where
D: RenderPassDescClearValues<C>,
sourcefn convert_clear_values(&self, vals: C) -> Box<dyn Iterator<Item = ClearValue>>
fn convert_clear_values(&self, vals: C) -> Box<dyn 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 moreAuto Trait Implementations
impl<D> RefUnwindSafe for RenderPass<D>where
D: RefUnwindSafe,
impl<D> Send for RenderPass<D>where
D: Send,
impl<D> Sync for RenderPass<D>where
D: Sync,
impl<D> Unpin for RenderPass<D>where
D: Unpin,
impl<D> UnwindSafe for RenderPass<D>where
D: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Content for T
impl<T> Content for T
sourcefn ref_from_ptr<'a>(ptr: *mut c_void, size: usize) -> Option<*mut T>
fn ref_from_ptr<'a>(ptr: *mut c_void, size: usize) -> Option<*mut T>
Builds a pointer to this type from a raw pointer.
sourcefn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Returns true if the size is suitable to store a type like this.
sourcefn indiv_size() -> usize
fn indiv_size() -> usize
Returns the size of an individual element.