vkCmdNextSubpass2(3)

# vkCmdNextSubpass2(3) Manual Page

## Name

vkCmdNextSubpass2 - Transition to the next subpass of a render pass

## C Specification

To transition to the next subpass in the render pass instance after recording the commands for a subpass, call:

Warning | This functionality is superseded by Vulkan Version 1.4. See Legacy Functionality for more information.

    // Provided by VK_VERSION_1_2
    void vkCmdNextSubpass2(
        VkCommandBuffer                             commandBuffer,
        const VkSubpassBeginInfo*                   pSubpassBeginInfo,
        const VkSubpassEndInfo*                     pSubpassEndInfo);

    // Provided by VK_KHR_create_renderpass2
    // Equivalent to vkCmdNextSubpass2
    void vkCmdNextSubpass2KHR(
        VkCommandBuffer                             commandBuffer,
        const VkSubpassBeginInfo*                   pSubpassBeginInfo,
        const VkSubpassEndInfo*                     pSubpassEndInfo);

## Parameters

- `commandBuffer` is the command buffer in which to record the command.

- `pSubpassBeginInfo` is a pointer to a VkSubpassBeginInfo structure containing information about the subpass which is about to begin rendering.

- `pSubpassEndInfo` is a pointer to a VkSubpassEndInfo structure containing information about how the previous subpass will be ended.

## Description

`vkCmdNextSubpass2` is semantically identical to vkCmdNextSubpass, except that it is extensible, and that `contents` is provided as part of an extensible structure instead of as a flat parameter.

Valid Usage

- VUID-vkCmdNextSubpass2-None-03102
  The current subpass index must be less than the number of subpasses in the render pass minus one

- VUID-vkCmdNextSubpass2-None-02350
  This command must not be recorded when transform feedback is active

Valid Usage (Implicit)

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

- VUID-vkCmdNextSubpass2-pSubpassBeginInfo-parameter
  `pSubpassBeginInfo` must be a valid pointer to a valid VkSubpassBeginInfo structure

- VUID-vkCmdNextSubpass2-pSubpassEndInfo-parameter
  `pSubpassEndInfo` must be a valid pointer to a valid VkSubpassEndInfo structure

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

- VUID-vkCmdNextSubpass2-commandBuffer-cmdpool
  The `VkCommandPool` that `commandBuffer` was allocated from must support VK_QUEUE_GRAPHICS_BIT operations

- VUID-vkCmdNextSubpass2-renderpass
  This command must only be called inside of a render pass instance

- VUID-vkCmdNextSubpass2-suspended
  This command must not be called between suspended render pass instances

- VUID-vkCmdNextSubpass2-videocoding
  This command must only be called outside of a video coding scope

- VUID-vkCmdNextSubpass2-bufferlevel
  `commandBuffer` must be a primary `VkCommandBuffer`

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 | Inside | Outside | VK_QUEUE_GRAPHICS_BIT | Action State Synchronization

Conditional Rendering

vkCmdNextSubpass2 is not affected by conditional rendering

## See Also

VK_KHR_create_renderpass2, VK_VERSION_1_2, VkCommandBuffer, VkSubpassBeginInfo, VkSubpassEndInfo

## 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-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0