## C Specification

The VkFramebufferCreateInfo structure is defined as:

typedef struct VkFramebufferCreateInfo {
VkStructureType             sType;
const void*                 pNext;
VkFramebufferCreateFlags    flags;
VkRenderPass                renderPass;
uint32_t                    attachmentCount;
const VkImageView*          pAttachments;
uint32_t                    width;
uint32_t                    height;
uint32_t                    layers;
} VkFramebufferCreateInfo;

## Members

• sType is the type of this structure.

• pNext is NULL or a pointer to an extension-specific structure.

• flags is reserved for future use.

• renderPass is a render pass that defines what render passes the framebuffer will be compatible with. See Render Pass Compatibility for details.

• attachmentCount is the number of attachments.

• pAttachments is an array of VkImageView handles, each of which will be used as the corresponding attachment in a render pass instance.

• width, height and layers define the dimensions of the framebuffer.

## Description

Applications must ensure that all accesses to memory that backs image subresources used as attachments in a given renderpass instance either happen-before the load operations for those attachments, or happen-after the store operations for those attachments.

 Note This restriction means that the render pass has full knowledge of all uses of all of the attachments, so that the implementation is able to make correct decisions about when and how to perform layout transitions, when to overlap execution of subpasses, etc.

It is legal for a subpass to use no color or depth/stencil attachments, and rather use shader side effects such as image stores and atomics to produce an output. In this case, the subpass continues to use the width, height, and layers of the framebuffer to define the dimensions of the rendering area, and the rasterizationSamples from each pipeline’s VkPipelineMultisampleStateCreateInfo to define the number of samples used in rasterization; however, if VkPhysicalDeviceFeatures::variableMultisampleRate is VK_FALSE, then all pipelines to be bound with a given zero-attachment subpass must have the same value for VkPipelineMultisampleStateCreateInfo::rasterizationSamples.

Valid Usage
• attachmentCount must be equal to the attachment count specified in renderPass

• Each element of pAttachments that is used as a color attachment or resolve attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT

• Each element of pAttachments that is used as a depth/stencil attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT

• Each element of pAttachments that is used as an input attachment by renderPass must have been created with a usage value including VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT

• Each element of pAttachments must have been created with an VkFormat value that matches the VkFormat specified by the corresponding VkAttachmentDescription in renderPass

• Each element of pAttachments must have been created with a samples value that matches the samples value specified by the corresponding VkAttachmentDescription in renderPass

• Each element of pAttachments must have dimensions at least as large as the corresponding framebuffer dimension

• Each element of pAttachments must only specify a single mip level

• Each element of pAttachments must have been created with the identity swizzle

• width must be greater than 0.

• width must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferWidth

• height must be greater than 0.

• height must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferHeight

• layers must be greater than 0.

• layers must be less than or equal to VkPhysicalDeviceLimits::maxFramebufferLayers

Valid Usage (Implicit)
• sType must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO

• pNext must be NULL

• flags must be 0

• renderPass must be a valid VkRenderPass handle

• If attachmentCount is not 0, pAttachments must be a valid pointer to an array of attachmentCount valid VkImageView handles

• Both of renderPass, and the elements of pAttachments that are valid handles must have been created, allocated, or retrieved from the same VkDevice