Trait vulkano::framebuffer::RenderPassDesc
source · pub unsafe trait RenderPassDesc: RenderPassDescClearValues<Vec<ClearValue>> {
Show 18 methods
fn num_attachments(&self) -> usize;
fn attachment_desc(&self, num: usize) -> Option<AttachmentDescription>;
fn num_subpasses(&self) -> usize;
fn subpass_desc(&self, num: usize) -> Option<PassDescription>;
fn num_dependencies(&self) -> usize;
fn dependency_desc(&self, num: usize) -> Option<PassDependencyDescription>;
fn attachment_descs(&self) -> RenderPassDescAttachments<'_, Self> ⓘ
where
Self: Sized,
{ ... }
fn subpass_descs(&self) -> RenderPassDescSubpasses<'_, Self> ⓘ
where
Self: Sized,
{ ... }
fn dependency_descs(&self) -> RenderPassDescDependencies<'_, Self> ⓘ
where
Self: Sized,
{ ... }
fn is_compatible_with<T>(&self, other: &T) -> bool
where
Self: Sized,
T: ?Sized + RenderPassDesc,
{ ... }
fn build_render_pass(
self,
device: Arc<Device>
) -> Result<RenderPass<Self>, RenderPassCreationError>
where
Self: Sized,
{ ... }
fn num_color_attachments(&self, subpass: u32) -> Option<u32> { ... }
fn num_samples(&self, subpass: u32) -> Option<u32> { ... }
fn has_depth_stencil_attachment(&self, subpass: u32) -> Option<(bool, bool)> { ... }
fn has_depth(&self, subpass: u32) -> Option<bool> { ... }
fn has_writable_depth(&self, subpass: u32) -> Option<bool> { ... }
fn has_stencil(&self, subpass: u32) -> Option<bool> { ... }
fn has_writable_stencil(&self, subpass: u32) -> Option<bool> { ... }
}
Expand description
Trait for objects that contain the description of a render pass.
See also all the traits whose name start with RenderPassDesc
(eg. RenderPassDescAttachments
or TODO: rename existing traits to match this). They are extensions to this trait.
Safety
TODO: finish this section
- All color and depth/stencil attachments used by any given subpass must have the same number of samples.
- The trait methods should always return the same values, unless you modify the description
through a mutable borrow. Once you pass the
RenderPassDesc
object to vulkano, you can still access it through theRenderPass::desc()
method that returns a shared borrow to the description. It must not be possible for a shared borrow to modify the description in such a way that the description changes. - The provided methods shouldn’t be overridden with fancy implementations. For example
build_render_pass
must build a render pass from the description and not a different one.
Required Methods
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.
Returns None
if num
is greater than or equal to num_attachments()
.
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.
Returns None
if num
is greater than or equal to num_subpasses()
.
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.
Returns None
if num
is greater than or equal to num_dependencies()
.
Provided Methods
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.
Two render passes that contain one subpass are compatible if they are identical. Two render passes that contain more than one subpass are compatible if they are identical except for the load/store operations and the image layouts.
This function is just a shortcut for the RenderPassCompatible
trait.
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.
Note: This function is just a shortcut for
RenderPass::new
.
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?
sourcefn 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.
sourcefn 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
.
sourcefn 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.
sourcefn has_writable_stencil(&self, subpass: u32) -> Option<bool>
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
.