Function Prototype

vkCmdSetScissorWithCount

Set the scissor count and scissor rectangular bounds dynamically for a command buffer

To dynamically set the scissor count and scissor rectangular bounds, call:

void vkCmdSetScissorWithCountEXT(
    VkCommandBuffer commandBuffer,
    uint32_t scissorCount,
    const VkRect2D* pScissors);
  • commandBuffer is the command buffer into which the command will be recorded.
  • scissorCount specifies the scissor count.
  • pScissors specifies the scissors to use for drawing.

This command sets the scissor count and scissor rectangular bounds state for subsequent drawing commands when drawing using shader objects, or when the graphics pipeline is created with VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the corresponding VkPipelineViewportStateCreateInfo::scissorCount and pScissors values used to create the currently active pipeline.

Valid Usage

VUID-vkCmdSetScissorWithCount-None-08971

At least one of the following must be true:- the extendedDynamicState feature is enabled

VUID-vkCmdSetScissorWithCount-scissorCount-03397

scissorCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive

VUID-vkCmdSetScissorWithCount-scissorCount-03398

If the multiViewport feature is not enabled, scissorCount must be 1

VUID-vkCmdSetScissorWithCount-x-03399

The x and y members of offset member of any element of pScissors must be greater than or equal to 0

VUID-vkCmdSetScissorWithCount-offset-03400

Evaluation of (offset.x + extent.width) must not cause a signed integer addition overflow for any element of pScissors

VUID-vkCmdSetScissorWithCount-offset-03401

Evaluation of (offset.y + extent.height) must not cause a signed integer addition overflow for any element of pScissors

::

Valid Usage (Implicit)

VUID-vkCmdSetScissorWithCount-pScissors-parameter

pScissors must be a valid pointer to an array of scissorCount VkRect2D structures

VUID-vkCmdSetScissorWithCount-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support graphics operations

VUID-vkCmdSetScissorWithCount-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 ::