Struct vulkano::render_pass::SubpassDescription
source · 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 Vec
s 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
impl Clone for SubpassDescription
source§fn clone(&self) -> SubpassDescription
fn clone(&self) -> SubpassDescription
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more