Function Prototype

vkCmdBeginRendering

Begin a dynamic render pass instance

To begin a render pass instance, call:

void vkCmdBeginRendering(
    VkCommandBuffer                   commandBuffer,
    const VkRenderingInfo*                              pRenderingInfo);
void vkCmdBeginRenderingKHR(
    VkCommandBuffer                   commandBuffer,
    const VkRenderingInfo*                              pRenderingInfo);
  • commandBuffer is the command buffer in which to record the command.
  • pRenderingInfo is a pointer to a VkRenderingInfo structure specifying details of the render pass instance to begin.

After beginning a render pass instance, the command buffer is ready to record draw commands.

If pRenderingInfo→flags includes VK_RENDERING_RESUMING_BIT then this render pass is resumed from a render pass instance that has been suspended earlier in submission order.

If there is an instance of VkTileMemorySizeInfoQCOM included in the pNext chain of VkRenderingInfo, the structure is ignored.

Valid Usage

VUID-vkCmdBeginRendering-commandBuffer-06068

If commandBuffer is a secondary command buffer, and the nestedCommandBuffer feature is not enabled, pRenderingInfo→flags must not include VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT

VUID-vkCmdBeginRendering-commandBuffer-10914

If commandBuffer is a secondary command buffer, VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT must not have been set in VkCommandBufferBeginInfo::flags when commandBuffer began

VUID-vkCmdBeginRendering-pRenderingInfo-09588

If pRenderingInfo→pDepthAttachment is not NULL and pRenderingInfo→pDepthAttachment→imageView is not VK_NULL_HANDLE, when pRenderingInfo→pDepthAttachment→imageView is accessed it must be in the layout specified by pRenderingInfo→pDepthAttachment→imageLayout

VUID-vkCmdBeginRendering-pRenderingInfo-09589

If pRenderingInfo→pDepthAttachment is not NULL, pRenderingInfo→pDepthAttachment→imageView is not VK_NULL_HANDLE, pRenderingInfo→pDepthAttachment→imageResolveMode is not VK_RESOLVE_MODE_NONE, and pRenderingInfo→pDepthAttachment→resolveImageView is not VK_NULL_HANDLE, pRenderingInfo→pDepthAttachment→resolveImageView must be in the layout specified by pRenderingInfo→pDepthAttachment→resolveImageLayout

VUID-vkCmdBeginRendering-pRenderingInfo-09590

If pRenderingInfo→pStencilAttachment is not NULL and pRenderingInfo→pStencilAttachment→imageView is not VK_NULL_HANDLE, when pRenderingInfo→pStencilAttachment→imageView is accessed it must be in the layout specified by pRenderingInfo→pStencilAttachment→imageLayout

VUID-vkCmdBeginRendering-pRenderingInfo-09591

If pRenderingInfo→pStencilAttachment is not NULL, pRenderingInfo→pStencilAttachment→imageView is not VK_NULL_HANDLE, pRenderingInfo→pStencilAttachment→imageResolveMode is not VK_RESOLVE_MODE_NONE, and pRenderingInfo→pStencilAttachment→resolveImageView is not VK_NULL_HANDLE, pRenderingInfo→pStencilAttachment→resolveImageView must be in the layout specified by pRenderingInfo→pStencilAttachment→resolveImageLayout

VUID-vkCmdBeginRendering-pRenderingInfo-09592

For each element of pRenderingInfo→pColorAttachments, if imageView is not VK_NULL_HANDLE, when that image view is accessed it must be in the layout specified by the imageLayout member of that same element of pRenderingInfo→pColorAttachments

VUID-vkCmdBeginRendering-pRenderingInfo-09593

For each element of pRenderingInfo→pColorAttachments, if either imageResolveMode is VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_BIT_ANDROID, or imageView is not VK_NULL_HANDLE and resolveMode is not VK_RESOLVE_MODE_NONE, and resolveImageView is not VK_NULL_HANDLE, resolveImageView must be in the layout specified by resolveImageLayout

VUID-vkCmdBeginRendering-flags-10641

If VK_TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM is included in VkRenderPassTileShadingCreateInfoQCOM::flags, commandBuffer must not have been recorded with VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT

VUID-vkCmdBeginRendering-flags-10642

VkRenderPassTileShadingCreateInfoQCOM::flags must not include VK_TILE_SHADING_RENDER_PASS_PER_TILE_EXECUTION_BIT_QCOM

VUID-vkCmdBeginRendering-pRenderingInfo-11750

If pRenderingInfo→flags contains VK_RENDERING_LOCAL_READ_CONCURRENT_ACCESS_CONTROL_BIT_KHR, maintenance10 must be enabled

VUID-vkCmdBeginRendering-pRenderingInfo-11751

If pRenderingInfo→flags does not contain VK_RENDERING_LOCAL_READ_CONCURRENT_ACCESS_CONTROL_BIT_KHR, attachments must not specify VK_RENDERING_ATTACHMENT_INPUT_ATTACHMENT_FEEDBACK_BIT_KHR

VUID-vkCmdBeginRendering-imageView-12276

If VkRenderingFragmentDensityMapAttachmentInfoEXT::imageView is not equal to VK_NULL_HANDLE, when imageView is accessed it must be in the layout specified by VkRenderingFragmentDensityMapAttachmentInfoEXT::imageLayout

VUID-vkCmdBeginRendering-imageView-12277

If VkRenderingFragmentShadingRateAttachmentInfoKHR::imageView is not equal to VK_NULL_HANDLE, when imageView is accessed it must be in the layout specified by VkRenderingFragmentShadingRateAttachmentInfoKHR::imageLayout

Valid Usage (Implicit)

VUID-vkCmdBeginRendering-pRenderingInfo-parameter

pRenderingInfo must be a valid pointer to a valid VkRenderingInfo structure

VUID-vkCmdBeginRendering-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_GRAPHICS_BIT operations

VUID-vkCmdBeginRendering-renderpass

This command must only be called outside of a render pass instance

VUID-vkCmdBeginRendering-suspended

This command must not be called between suspended render pass instances

VUID-vkCmdBeginRendering-videocoding

This command must only be called outside of a video coding scope

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized