pub struct SubpassDescription {
    pub flags: SubpassDescriptionFlags,
    pub view_mask: u32,
    pub input_attachments: Vec<Option<AttachmentReference>>,
    pub color_attachments: Vec<Option<AttachmentReference>>,
    pub color_resolve_attachments: Vec<Option<AttachmentReference>>,
    pub depth_stencil_attachment: Option<AttachmentReference>,
    pub depth_stencil_resolve_attachment: Option<AttachmentReference>,
    pub depth_resolve_mode: Option<ResolveMode>,
    pub stencil_resolve_mode: Option<ResolveMode>,
    pub preserve_attachments: Vec<u32>,
    pub _ne: NonExhaustive,
}
Expand description

Describes one of the subpasses of a render pass.

A subpass can use zero or more attachments of various types. Attachment types of which there can be multiple are listed in a Vec in this structure. The index in these Vecs corresponds to the index used for that attachment type in the shader.

If a particular index is not used in the shader, it can be set to None in this structure. This is useful if an unused index needs to be skipped but a higher index needs to be specified.

If an attachment is used more than once, i.e. a given AttachmentReference::attachment occurs more than once in the SubpassDescription, then their AttachmentReference::layout must be the same as well.

Fields§

§flags: SubpassDescriptionFlags

Additional properties of the subpass.

The default value is empty.

§view_mask: u32

If not 0, enables multiview rendering, and specifies the view indices that are rendered to in this subpass. The value is a bitmask, so that that for example 0b11 will draw to the first two views and 0b101 will draw to the first and third view.

If set to a nonzero value, it must be nonzero for all subpasses in the render pass, and the multiview feature must be enabled on the device.

The default value is 0.

§input_attachments: Vec<Option<AttachmentReference>>

The attachments of the render pass that are to be used as input attachments in this subpass.

If an attachment is used here for the first time in this render pass, and it’s is not also used as a color or depth/stencil attachment in this subpass, then the attachment’s load_op must not be AttachmentLoadOp::Clear.

The default value is empty.

§color_attachments: Vec<Option<AttachmentReference>>

The attachments of the render pass that are to be used as color attachments in this subpass.

The number of color attachments must be less than the max_color_attachments limit of the physical device. All color attachments must have the same samples value.

The default value is empty.

§color_resolve_attachments: Vec<Option<AttachmentReference>>

The attachments of the render pass that are to be used as color resolve attachments in this subpass.

This list must either be empty or have the same length as color_attachments. If it’s not empty, then each resolve attachment is paired with the color attachment of the same index. Each referenced color resolve attachment must have the same format as the corresponding color attachment. If the color resolve attachment is Some, then the referenced color resolve attachment must have a samples value of SampleCount::Sample1, while the corresponding color attachment must have a samples value other than SampleCount::Sample1.

The default value is empty.

§depth_stencil_attachment: Option<AttachmentReference>

The single attachment of the render pass that is to be used as depth/stencil attachment in this subpass.

If set to Some, the referenced attachment must have the same samples value as those in color_attachments.

The default value is None.

§depth_stencil_resolve_attachment: Option<AttachmentReference>

The single attachment of the render pass that is to be used as depth/stencil resolve attachment in this subpass.

The depth/stencil resolve attachment must have the same format as the depth/stencil attachment. If this is Some, then depth_stencil_attachment must also be Some, and at least one of depth_resolve_mode and stencil_resolve_mode must be Some. The referenced depth/stencil resolve attachment must have a samples value of SampleCount::Sample1, while the depth/stencil attachment must have a samples value other than SampleCount::Sample1.

If this is Some, then the device API version must be at least 1.2, or the khr_depth_stencil_resolve extension must be enabled on the device.

The default value is None.

§depth_resolve_mode: Option<ResolveMode>

How the resolve operation should be performed for the depth aspect. If set to None, no resolve is performed for the depth aspect.

If depth_stencil_resolve_attachment is None, this must also be None.

The default value is None.

§stencil_resolve_mode: Option<ResolveMode>

How the resolve operation should be performed for the stencil aspect. If set to None, no resolve is performed for the stencil aspect.

If depth_stencil_resolve_attachment is None, this must also be None.

The default value is None.

§preserve_attachments: Vec<u32>

The indices of attachments of the render pass that will be preserved during this subpass.

The referenced attachments must not be used as any other attachment type in the subpass.

The default value is empty.

§_ne: NonExhaustive

Trait Implementations§

source§

impl Clone for SubpassDescription

source§

fn clone(&self) -> SubpassDescription

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubpassDescription

source§

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

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

impl Default for SubpassDescription

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.