C Specification

The VkCommandBufferInheritanceViewportScissorInfoNV structure is defined as:

// Provided by VK_NV_inherited_viewport_scissor
typedef struct VkCommandBufferInheritanceViewportScissorInfoNV {
    VkStructureType      sType;
    const void*          pNext;
    VkBool32             viewportScissor2D;
    uint32_t             viewportDepthCount;
    const VkViewport*    pViewportDepths;
} VkCommandBufferInheritanceViewportScissorInfoNV;


  • sType is the type of this structure.

  • pNext is NULL or a pointer to a structure extending this structure.

  • viewportScissor2D specifies whether the listed dynamic state is inherited.

  • viewportDepthCount specifies the maximum number of viewports to inherit. When viewportScissor2D is VK_FALSE, the behavior is as if this value is zero.

  • pViewportDepths specifies the expected depth range for each inherited viewport.


If the pNext chain of VkCommandBufferInheritanceInfo includes a VkCommandBufferInheritanceViewportScissorInfoNV structure, then that structure controls whether a command buffer can inherit the following state from other command buffers:




as well as the following state, with restrictions on inherited depth values and viewport count:



If viewportScissor2D is VK_FALSE, then the command buffer does not inherit the listed dynamic state, and should set this state itself. If this structure is not present, the behavior is as if viewportScissor2D is VK_FALSE.

If viewportScissor2D is VK_TRUE, then the listed dynamic state is inherited, and the command buffer must not set this state, except that the viewport and scissor count may be set by binding a graphics pipeline that does not specify this state as dynamic.


Due to this restriction, applications should ensure either all or none of the graphics pipelines bound in this secondary command buffer use dynamic viewport/scissor counts.

When the command buffer is executed as part of a the execution of a vkCmdExecuteCommands command, the inherited state (if enabled) is determined by the following procedure, performed separately for each dynamic state, and separately for each value for dynamic state that consists of multiple values (e.g. multiple viewports).

  • With being the index of the executed command buffer in the pCommandBuffers array of vkCmdExecuteCommands, if and any secondary command buffer from index to modifies the state, the inherited state is provisionally set to the final value set by the last such secondary command buffer. Binding a graphics pipeline that defines the state statically is equivalent to setting the state to an undefined value.

  • Otherwise, the tentatative inherited state is that of the primary command buffer at the point the vkCmdExecuteCommands command was recorded; if the state is undefined, then so is the provisional inherited state.

  • If the provisional inherited state is an undefined value, then the state is not inherited.

  • If the provisional inherited state is a viewport, with being its viewport index, then if viewportDepthCount, or if either VkViewport::minDepth or VkViewport::maxDepth are not equal to the respective values of the element of pViewportDepths, then the state is not inherited.

  • If the provisional inherited state passes both checks, then it becomes the actual inherited state.


There is no support for inheriting dynamic state from a secondary command buffer executed as part of a different vkCmdExecuteCommands command.

Valid Usage
  • VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04782
    If the inherited viewport scissor feature is not enabled, viewportScissor2D must be VK_FALSE

  • VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04783
    If the multiple viewports feature is not enabled and viewportScissor2D is VK_TRUE, then viewportDepthCount must be 1

  • VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04784
    If viewportScissor2D is VK_TRUE, then viewportDepthCount must be greater than 0

  • VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04785
    If viewportScissor2D is VK_TRUE, then pViewportDepths must be a valid pointer to an array of viewportDepthCount valid VkViewport structures, except any requirements on x, y, width, and height do not apply.

  • VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04786
    If viewportScissor2D is VK_TRUE, then the command buffer must be recorded with the VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT.

Valid Usage (Implicit)
  • VUID-VkCommandBufferInheritanceViewportScissorInfoNV-sType-sType

See Also

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 2014-2021 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0