logo
pub struct SubpassDescription {
    pub view_mask: u32,
    pub input_attachments: Vec<Option<AttachmentReference>>,
    pub color_attachments: Vec<Option<AttachmentReference>>,
    pub resolve_attachments: Vec<Option<AttachmentReference>>,
    pub depth_stencil_attachment: Option<AttachmentReference>,
    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

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 LoadOp::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.

resolve_attachments: Vec<Option<AttachmentReference>>

The attachments of the render pass that are to be used as 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. The resolve attachments must all have a samples value of SampleCount::Sample1, while the color attachments must have a samples value other than SampleCount::Sample1. Each resolve attachment must have the same format as the corresponding color attachment.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.