# vkCmdBeginRendering(3) Manual Page

## Name

vkCmdBeginRendering - Begin a dynamic render pass instance

Loading… please wait.

## C Specification

To begin a render pass instance, call:

    // Provided by VK_VERSION_1_3
    void vkCmdBeginRendering(
        VkCommandBuffer                             commandBuffer,
        const VkRenderingInfo*                      pRenderingInfo);

or the equivalent command

    // Provided by VK_KHR_dynamic_rendering
    void vkCmdBeginRenderingKHR(
        VkCommandBuffer                             commandBuffer,
        const VkRenderingInfo*                      pRenderingInfo);

## Parameters

- `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.

## Description

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.

Valid Usage

- VUID-vkCmdBeginRendering-dynamicRendering-06446
  The `dynamicRendering` feature must be enabled

- 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-pRenderingInfo-09588
  If `pRenderingInfo->pDepthAttachment` is not `NULL` and `pRenderingInfo->pDepthAttachment->imageView` is not VK_NULL_HANDLE, `pRenderingInfo->pDepthAttachment->imageView` 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, `pRenderingInfo->pStencilAttachment->imageView` 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 any element of `pRenderingInfo->pColorAttachments`, if `imageView` is not VK_NULL_HANDLE, that image view must be in the layout specified by `imageLayout`

- VUID-vkCmdBeginRendering-pRenderingInfo-09593
  For any element of `pRenderingInfo->pColorAttachments`, if either `imageResolveMode` is `VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_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`

Valid Usage (Implicit)

- VUID-vkCmdBeginRendering-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdBeginRendering-pRenderingInfo-parameter
  `pRenderingInfo` must be a valid pointer to a valid VkRenderingInfo structure

- VUID-vkCmdBeginRendering-commandBuffer-recording
  `commandBuffer` must be in the recording state

- VUID-vkCmdBeginRendering-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support graphics operations

- VUID-vkCmdBeginRendering-renderpass
  This command must only be called outside of a render pass instance

- 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

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Outside | Outside | Graphics | Action State

## See Also

VK_KHR_dynamic_rendering, VK_VERSION_1_3, VkCommandBuffer, VkRenderingInfo

## 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.

## Copyright

Copyright 2014-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0