C Specification
To begin a render pass instance, call:
// Provided by VK_VERSION_1_0
void vkCmdBeginRenderPass(
VkCommandBuffer commandBuffer,
const VkRenderPassBeginInfo* pRenderPassBegin,
VkSubpassContents contents);
Parameters
-
commandBuffer
is the command buffer in which to record the command. -
pRenderPassBegin
is a pointer to a VkRenderPassBeginInfo structure specifying the render pass to begin an instance of, and the framebuffer the instance uses. -
contents
is a VkSubpassContents value specifying how the commands in the first subpass will be provided.
Description
After beginning a render pass instance, the command buffer is ready to record the commands for the first subpass of that render pass.
-
VUID-vkCmdBeginRenderPass-initialLayout-00895
If any of theinitialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
then the corresponding attachment image view of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created with ausage
value includingVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-initialLayout-01758
If any of theinitialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
,VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
,VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
, orVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
then the corresponding attachment image view of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created with ausage
value includingVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-initialLayout-02842
If any of theinitialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL
, orVK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
,VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL
, orVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
then the corresponding attachment image view of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created with ausage
value includingVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-stencilInitialLayout-02843
If any of thestencilInitialLayout
orstencilFinalLayout
member of theVkAttachmentDescriptionStencilLayout
structures or thestencilLayout
member of theVkAttachmentReferenceStencilLayout
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL
, orVK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
then the corresponding attachment image view of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created with ausage
value includingVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-initialLayout-00897
If any of theinitialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
then the corresponding attachment image view of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created with ausage
value includingVK_IMAGE_USAGE_SAMPLED_BIT
orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-initialLayout-00898
If any of theinitialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
then the corresponding attachment image view of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created with ausage
value includingVK_IMAGE_USAGE_TRANSFER_SRC_BIT
-
VUID-vkCmdBeginRenderPass-initialLayout-00899
If any of theinitialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
then the corresponding attachment image view of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created with ausage
value includingVK_IMAGE_USAGE_TRANSFER_DST_BIT
-
VUID-vkCmdBeginRenderPass-initialLayout-00900
If any of theinitialLayout
members of theVkAttachmentDescription
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
is notVK_IMAGE_LAYOUT_UNDEFINED
, then each suchinitialLayout
must be equal to the current layout of the corresponding attachment image subresource of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
-
VUID-vkCmdBeginRenderPass-srcStageMask-00901
ThesrcStageMask
anddstStageMask
members of any element of thepDependencies
member of VkRenderPassCreateInfo used to createrenderPass
must be supported by the capabilities of the queue family identified by thequeueFamilyIndex
member of the VkCommandPoolCreateInfo used to create the command pool whichcommandBuffer
was allocated from -
VUID-vkCmdBeginRenderPass-framebuffer-02532
For any attachment inframebuffer
that is used byrenderPass
and is bound to memory locations that are also bound to another attachment used byrenderPass
, and if at least one of those uses causes either attachment to be written to, both attachments must have had theVK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT
set -
VUID-vkCmdBeginRenderPass-pAttachments-04102
Each element of thepAttachments
offramebuffer
that is referenced by any element of thepInputAttachments
of any element ofpSubpasses
ofrenderPass
must have image view format features containing at leastVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
orVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-pAttachments-04103
Each element of thepAttachments
offramebuffer
that is referenced by any element of thepColorAttachments
of any element ofpSubpasses
ofrenderPass
must have image view format features containingVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-pAttachments-04104
Each element of thepAttachments
offramebuffer
that is referenced by any element of thepResolveAttachments
of any element ofpSubpasses
ofrenderPass
must have image view format features containingVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-pAttachments-04105
Each element of thepAttachments
offramebuffer
that is referenced by any element of thepDepthStencilAttachment
of any element ofpSubpasses
ofrenderPass
must have image view format features containingVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
-
VUID-vkCmdBeginRenderPass-commandBuffer-parameter
commandBuffer
must be a valid VkCommandBuffer handle -
VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter
pRenderPassBegin
must be a valid pointer to a valid VkRenderPassBeginInfo structure -
VUID-vkCmdBeginRenderPass-contents-parameter
contents
must be a valid VkSubpassContents value -
VUID-vkCmdBeginRenderPass-commandBuffer-recording
commandBuffer
must be in the recording state -
VUID-vkCmdBeginRenderPass-commandBuffer-cmdpool
TheVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations -
VUID-vkCmdBeginRenderPass-renderpass
This command must only be called outside of a render pass instance -
VUID-vkCmdBeginRenderPass-bufferlevel
commandBuffer
must be a primaryVkCommandBuffer
-
Host access to
commandBuffer
must be externally synchronized -
Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
---|---|---|---|
Primary |
Outside |
Graphics |
Graphics |
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.