C Specification
To begin a render pass instance, call:
|
Warning
|
This functionality is superseded by Vulkan Version 1.2. See Legacy Functionality for more information. |
// Provided by VK_VERSION_1_0
void vkCmdBeginRenderPass(
VkCommandBuffer commandBuffer,
const VkRenderPassBeginInfo* pRenderPassBegin,
VkSubpassContents contents);
Parameters
-
commandBufferis the command buffer in which to record the command. -
pRenderPassBeginis a pointer to a VkRenderPassBeginInfo structure specifying the render pass to begin an instance of, and the framebuffer the instance uses. -
contentsis 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 theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT usage flag set -
VUID-vkCmdBeginRenderPass-initialLayout-01758
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT usage flag set -
VUID-vkCmdBeginRenderPass-initialLayout-02842
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT usage flag set -
VUID-vkCmdBeginRenderPass-stencilInitialLayout-02843
If any of thestencilInitialLayoutorstencilFinalLayoutmember of theVkAttachmentDescriptionStencilLayoutstructures or thestencilLayoutmember of theVkAttachmentReferenceStencilLayoutstructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT usage flag set -
VUID-vkCmdBeginRenderPass-initialLayout-00897
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_SAMPLED_BIT or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT usage flags set -
VUID-vkCmdBeginRenderPass-initialLayout-00898
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag set -
VUID-vkCmdBeginRenderPass-initialLayout-00899
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag set -
VUID-vkCmdBeginRenderPass-initialLayout-00900
If theinitialLayoutmember of any of theVkAttachmentDescriptionstructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis not VK_IMAGE_LAYOUT_UNDEFINED, then each suchinitialLayoutmust be equal to the current layout of the corresponding attachment image subresource of the framebuffer specified in theframebuffermember ofpRenderPassBegin -
VUID-vkCmdBeginRenderPass-srcStageMask-06451
ThesrcStageMaskmembers of any element of thepDependenciesmember of VkRenderPassCreateInfo used to createrenderPassmust be supported by the capabilities of the queue family identified by thequeueFamilyIndexmember of the VkCommandPoolCreateInfo used to create the command pool whichcommandBufferwas allocated from -
VUID-vkCmdBeginRenderPass-dstStageMask-06452
ThedstStageMaskmembers of any element of thepDependenciesmember of VkRenderPassCreateInfo used to createrenderPassmust be supported by the capabilities of the queue family identified by thequeueFamilyIndexmember of the VkCommandPoolCreateInfo used to create the command pool whichcommandBufferwas allocated from -
VUID-vkCmdBeginRenderPass-framebuffer-02532
For any attachment inframebufferthat is used byrenderPassand 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 the VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT set -
VUID-vkCmdBeginRenderPass-framebuffer-09045
If any attachments specified inframebufferare used byrenderPassand are bound to overlapping memory locations, there must be only one that is used as a color attachment, depth/stencil, or resolve attachment in any subpass -
VUID-vkCmdBeginRenderPass-initialLayout-07000
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with either the VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT or VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT usage flags set, and either the VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT or VK_IMAGE_USAGE_SAMPLED_BIT usage flags set -
VUID-vkCmdBeginRenderPass-initialLayout-07001
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with the VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT usage flag set -
VUID-vkCmdBeginRenderPass-initialLayout-09537
If any of theinitialLayoutorfinalLayoutmember of theVkAttachmentDescriptionstructures or thelayoutmember of theVkAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ then the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with either the VK_IMAGE_USAGE_STORAGE_BIT usage flag set, or both the VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT and either of VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT or VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT usage flags set -
VUID-vkCmdBeginRenderPass-contents-09640
Ifcontentsis VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR, then at least one of the following features must be enabled:
-
VUID-vkCmdBeginRenderPass-commandBuffer-parameter
commandBuffermust be a valid VkCommandBuffer handle -
VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter
pRenderPassBeginmust be a valid pointer to a valid VkRenderPassBeginInfo structure -
VUID-vkCmdBeginRenderPass-contents-parameter
contentsmust be a valid VkSubpassContents value -
VUID-vkCmdBeginRenderPass-commandBuffer-recording
commandBuffermust be in the recording state -
VUID-vkCmdBeginRenderPass-commandBuffer-cmdpool
TheVkCommandPoolthatcommandBufferwas allocated from must support VK_QUEUE_GRAPHICS_BIT operations -
VUID-vkCmdBeginRenderPass-renderpass
This command must only be called outside of a render pass instance -
VUID-vkCmdBeginRenderPass-suspended
This command must not be called between suspended render pass instances -
VUID-vkCmdBeginRenderPass-videocoding
This command must only be called outside of a video coding scope -
VUID-vkCmdBeginRenderPass-bufferlevel
commandBuffermust be a primaryVkCommandBuffer
-
Host access to
commandBuffermust be externally synchronized -
Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
| Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
|---|---|---|---|---|
Primary |
Outside |
Outside |
VK_QUEUE_GRAPHICS_BIT |
Action |
vkCmdBeginRenderPass is not affected by conditional rendering
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.