C Specification
The VkFramebufferCreateInfo
structure is defined as:
// Provided by VK_VERSION_1_0
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 a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
flags
is a bitmask of VkFramebufferCreateFlagBits -
renderPass
is a render pass defining what render passes the framebuffer will be compatible with. See Render Pass Compatibility for details. -
attachmentCount
is the number of attachments. -
pAttachments
is a pointer to an array of VkImageView handles, each of which will be used as the corresponding attachment in a render pass instance. Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, this parameter is ignored. -
width
,height
andlayers
define the dimensions of the framebuffer. If the render pass uses multiview, thenlayers
must be one and each attachment requires a number of layers that is greater than the maximum bit index set in the view mask in the subpasses in which it is used.
Description
It is legal for a subpass to use no color or depth/stencil attachments,
either because it has no attachment references or because all of them are
VK_ATTACHMENT_UNUSED
.
This kind of subpass can 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 the subpass must have
the same value for
VkPipelineMultisampleStateCreateInfo::rasterizationSamples
.
In all such cases, rasterizationSamples
must be a bit value that is
set in
VkPhysicalDeviceLimits::framebufferNoAttachmentsSampleCounts
.
-
VUID-VkFramebufferCreateInfo-attachmentCount-00876
attachmentCount
must be equal to the attachment count specified inrenderPass
-
VUID-VkFramebufferCreateInfo-flags-02778
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
andattachmentCount
is not0
,pAttachments
must be a valid pointer to an array ofattachmentCount
valid VkImageView handles -
VUID-VkFramebufferCreateInfo-pAttachments-00877
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as a color attachment or resolve attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-pAttachments-02633
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as a depth/stencil attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-pAttachments-02634
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as a depth/stencil resolve attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-pAttachments-00879
Ifrenderpass
is not VK_NULL_HANDLE,flags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as an input attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-pAttachments-02552
Each element ofpAttachments
that is used as a fragment density map attachment byrenderPass
must not have been created with aflags
value includingVK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT
-
VUID-VkFramebufferCreateInfo-renderPass-02553
IfrenderPass
has a fragment density map attachment and thefragmentDensityMapNonSubsampledImages
feature is not enabled, each element ofpAttachments
must have been created with aflags
value includingVK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT
unless that element is the fragment density map attachment -
VUID-VkFramebufferCreateInfo-renderPass-06502
IfrenderPass
was created with fragment density map offsets other than (0,0), each element ofpAttachments
must have been created with aflags
value includingVK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM
-
VUID-VkFramebufferCreateInfo-pAttachments-00880
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
must have been created with a VkFormat value that matches the VkFormat specified by the correspondingVkAttachmentDescription
inrenderPass
-
VUID-VkFramebufferCreateInfo-pAttachments-00881
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
must have been created with asamples
value that matches thesamples
value specified by the correspondingVkAttachmentDescription
inrenderPass
-
VUID-VkFramebufferCreateInfo-flags-04533
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as an input, color, resolve, or depth/stencil attachment byrenderPass
must have been created with a VkImageCreateInfo::extent.width
greater than or equal towidth
-
VUID-VkFramebufferCreateInfo-flags-04534
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as an input, color, resolve, or depth/stencil attachment byrenderPass
must have been created with a VkImageCreateInfo::extent.height
greater than or equal toheight
-
VUID-VkFramebufferCreateInfo-flags-04535
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as an input, color, resolve, or depth/stencil attachment byrenderPass
must have been created with a VkImageViewCreateInfo::subresourceRange.layerCount
greater than or equal tolayers
-
VUID-VkFramebufferCreateInfo-renderPass-04536
IfrenderPass
was specified with non-zero view masks, each element ofpAttachments
that is used as an input, color, resolve, or depth/stencil attachment byrenderPass
must have alayerCount
greater than the index of the most significant bit set in any of those view masks -
VUID-VkFramebufferCreateInfo-renderPass-02746
IfrenderPass
was specified with non-zero view masks, each element ofpAttachments
that is referenced byfragmentDensityMapAttachment
must have alayerCount
equal to1
or greater than the index of the most significant bit set in any of those view masks -
VUID-VkFramebufferCreateInfo-renderPass-02747
IfrenderPass
was specified with all view masks equal to zero, each element ofpAttachments
that is referenced byfragmentDensityMapAttachment
must have alayerCount
equal to1
-
VUID-VkFramebufferCreateInfo-pAttachments-02555
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, an element ofpAttachments
that is referenced byfragmentDensityMapAttachment
must have a width at least as large as ⌈maxFragmentDensityTexelSizewidthwidth⌉ -
VUID-VkFramebufferCreateInfo-pAttachments-02556
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, an element ofpAttachments
that is referenced byfragmentDensityMapAttachment
must have a height at least as large as ⌈maxFragmentDensityTexelSizeheightheight⌉ -
VUID-VkFramebufferCreateInfo-flags-04537
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, andrenderPass
was specified with non-zero view masks, each element ofpAttachments
that is used as a fragment shading rate attachment byrenderPass
must have alayerCount
that is either1
, or greater than the index of the most significant bit set in any of those view masks -
VUID-VkFramebufferCreateInfo-flags-04538
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, andrenderPass
was not specified with non-zero view masks, each element ofpAttachments
that is used as a fragment shading rate attachment byrenderPass
must have alayerCount
that is either1
, or greater thanlayers
-
VUID-VkFramebufferCreateInfo-renderPass-08921
IfrenderPass
was specified with non-zero view masks, each element ofpAttachments
that is used as a fragment shading rate attachment must have alayerCount
equal to1
or greater than the index of the most significant bit set in any of those view masks -
VUID-VkFramebufferCreateInfo-flags-04539
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, an element ofpAttachments
that is used as a fragment shading rate attachment must have a width at least as large as ⌈width
/texelWidth
⌉, wheretexelWidth
is the largest value ofshadingRateAttachmentTexelSize.width
in a VkFragmentShadingRateAttachmentInfoKHR which references that attachment -
VUID-VkFramebufferCreateInfo-flags-04540
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, an element ofpAttachments
that is used as a fragment shading rate attachment must have a height at least as large as ⌈height
/texelHeight
⌉, wheretexelHeight
is the largest value ofshadingRateAttachmentTexelSize.height
in a VkFragmentShadingRateAttachmentInfoKHR which references that attachment -
VUID-VkFramebufferCreateInfo-pAttachments-00883
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
must only specify a single mip level -
VUID-VkFramebufferCreateInfo-pAttachments-00884
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
must have been created with the identity swizzle -
VUID-VkFramebufferCreateInfo-width-00885
width
must be greater than0
-
VUID-VkFramebufferCreateInfo-width-00886
width
must be less than or equal tomaxFramebufferWidth
-
VUID-VkFramebufferCreateInfo-height-00887
height
must be greater than0
-
VUID-VkFramebufferCreateInfo-height-00888
height
must be less than or equal tomaxFramebufferHeight
-
VUID-VkFramebufferCreateInfo-layers-00889
layers
must be greater than0
-
VUID-VkFramebufferCreateInfo-layers-00890
layers
must be less than or equal tomaxFramebufferLayers
-
VUID-VkFramebufferCreateInfo-renderPass-02531
IfrenderPass
was specified with non-zero view masks,layers
must be1
-
VUID-VkFramebufferCreateInfo-pAttachments-00891
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is a 2D or 2D array image view taken from a 3D image must not be a depth/stencil format -
VUID-VkFramebufferCreateInfo-flags-03189
If theimagelessFramebuffer
feature is not enabled,flags
must not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
-
VUID-VkFramebufferCreateInfo-flags-03190
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, thepNext
chain must include a VkFramebufferAttachmentsCreateInfo structure -
VUID-VkFramebufferCreateInfo-flags-03191
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theattachmentImageInfoCount
member of a VkFramebufferAttachmentsCreateInfo structure in thepNext
chain must be equal to either zero orattachmentCount
-
VUID-VkFramebufferCreateInfo-flags-04541
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, thewidth
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure in thepNext
chain that is used as an input, color, resolve or depth/stencil attachment inrenderPass
must be greater than or equal towidth
-
VUID-VkFramebufferCreateInfo-flags-04542
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theheight
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure in thepNext
chain that is used as an input, color, resolve or depth/stencil attachment inrenderPass
must be greater than or equal toheight
-
VUID-VkFramebufferCreateInfo-flags-03196
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, thewidth
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure in thepNext
chain that is referenced by VkRenderPassFragmentDensityMapCreateInfoEXT::fragmentDensityMapAttachment
inrenderPass
must be greater than or equal to ⌈maxFragmentDensityTexelSizewidthwidth⌉ -
VUID-VkFramebufferCreateInfo-flags-03197
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theheight
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain that is referenced by VkRenderPassFragmentDensityMapCreateInfoEXT::fragmentDensityMapAttachment
inrenderPass
must be greater than or equal to ⌈maxFragmentDensityTexelSizeheightheight⌉ -
VUID-VkFramebufferCreateInfo-flags-04543
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, thewidth
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure in thepNext
chain that is used as a fragment shading rate attachment must be greater than or equal to ⌈width
/texelWidth
⌉, wheretexelWidth
is the largest value ofshadingRateAttachmentTexelSize.width
in a VkFragmentShadingRateAttachmentInfoKHR which references that attachment -
VUID-VkFramebufferCreateInfo-flags-04544
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theheight
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure in thepNext
chain that is used as a fragment shading rate attachment must be greater than or equal to ⌈height
/texelHeight
⌉, wheretexelHeight
is the largest value ofshadingRateAttachmentTexelSize.height
in a VkFragmentShadingRateAttachmentInfoKHR which references that attachment -
VUID-VkFramebufferCreateInfo-flags-04545
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, thelayerCount
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure in thepNext
chain that is used as a fragment shading rate attachment must be either1
, or greater than or equal tolayers
-
VUID-VkFramebufferCreateInfo-flags-04587
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
andrenderPass
was specified with non-zero view masks, each element ofpAttachments
that is used as a fragment shading rate attachment byrenderPass
must have alayerCount
that is either1
, or greater than the index of the most significant bit set in any of those view masks -
VUID-VkFramebufferCreateInfo-renderPass-03198
If multiview is enabled forrenderPass
andflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, thelayerCount
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain used as an input, color, resolve, or depth/stencil attachment inrenderPass
must be greater than the maximum bit index set in the view mask in the subpasses in which it is used inrenderPass
-
VUID-VkFramebufferCreateInfo-renderPass-04546
If multiview is not enabled forrenderPass
andflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, thelayerCount
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain used as an input, color, resolve, or depth/stencil attachment inrenderPass
must be greater than or equal tolayers
-
VUID-VkFramebufferCreateInfo-flags-03201
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theusage
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain that refers to an attachment used as a color attachment or resolve attachment byrenderPass
must includeVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-flags-03202
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theusage
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain that refers to an attachment used as a depth/stencil attachment byrenderPass
must includeVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-flags-03203
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theusage
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain that refers to an attachment used as a depth/stencil resolve attachment byrenderPass
must includeVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-flags-03204
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theusage
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain that refers to an attachment used as an input attachment byrenderPass
must includeVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
-
VUID-VkFramebufferCreateInfo-flags-03205
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, at least one element of thepViewFormats
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain must be equal to the corresponding value of VkAttachmentDescription::format
used to createrenderPass
-
VUID-VkFramebufferCreateInfo-flags-04113
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
must have been created with VkImageViewCreateInfo::viewType
not equal toVK_IMAGE_VIEW_TYPE_3D
-
VUID-VkFramebufferCreateInfo-flags-04548
Ifflags
does not includeVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, each element ofpAttachments
that is used as a fragment shading rate attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
-
VUID-VkFramebufferCreateInfo-flags-04549
Ifflags
includesVK_FRAMEBUFFER_CREATE_IMAGELESS_BIT
, theusage
member of any element of thepAttachmentImageInfos
member of a VkFramebufferAttachmentsCreateInfo structure included in thepNext
chain that refers to an attachment used as a fragment shading rate attachment byrenderPass
must includeVK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
-
VUID-VkFramebufferCreateInfo-samples-06881
If multisampled-render-to-single-sampled is enabled for any subpass, all color, depth/stencil and input attachments used in that subpass which haveVkAttachmentDescription
::samples
orVkAttachmentDescription2
::samples
equal toVK_SAMPLE_COUNT_1_BIT
must have been created withVK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT
in their VkImageCreateInfo::flags
-
VUID-VkFramebufferCreateInfo-samples-07009
If multisampled-render-to-single-sampled is enabled for any subpass, all color, depth/stencil and input attachments used in that subpass which haveVkAttachmentDescription
::samples
orVkAttachmentDescription2
::samples
equal toVK_SAMPLE_COUNT_1_BIT
must have a format that supports the sample count specified in VkMultisampledRenderToSingleSampledInfoEXT::rasterizationSamples
-
VUID-VkFramebufferCreateInfo-sType-sType
sType
must beVK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
-
VUID-VkFramebufferCreateInfo-pNext-pNext
pNext
must beNULL
or a pointer to a valid instance of VkFramebufferAttachmentsCreateInfo -
VUID-VkFramebufferCreateInfo-sType-unique
ThesType
value of each struct in thepNext
chain must be unique -
VUID-VkFramebufferCreateInfo-flags-parameter
flags
must be a valid combination of VkFramebufferCreateFlagBits values -
VUID-VkFramebufferCreateInfo-renderPass-parameter
renderPass
must be a valid VkRenderPass handle -
VUID-VkFramebufferCreateInfo-commonparent
Both ofrenderPass
, and the elements ofpAttachments
that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.