Specifying attachments descriptions
A render pass represents a set of resources (images) called attachments, which are used during rendering operations. These are divided into color, depth/stencil, input, or resolve attachments. Before we can create a render pass, we need to describe all the attachments used in it.
How to do it...
- Create a vector with elements of type
VkAttachmentDescription
. Call the vectorattachments_descriptions
. For each attachment used in a render pass, add an element to theattachments_descriptions
vector and use the following values for its members:0
value forflags
- The selected format of a given attachment for
format
- The number of per pixel samples for
samples
- For
loadOp
, specify the type of operation that should be performed on an attachment's contents when a render pass is started--aVK_ATTACHMENT_LOAD_OP_CLEAR
value if the attachment contents should be cleared, aVK_ATTACHMENT_LOAD_OP_LOAD
value if its current contents should be preserved or aVK_ATTACHMENT_LOAD_OP_DONT_CARE...