vkCmdSetScissorWithCount(3)

# vkCmdSetScissorWithCount(3) Manual Page

## Name

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

Loading… please wait.

## C Specification

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

    // Provided by VK_VERSION_1_3
    void vkCmdSetScissorWithCount(
        VkCommandBuffer                             commandBuffer,
        uint32_t                                    scissorCount,
        const VkRect2D*                             pScissors);

or the equivalent command

    // Provided by VK_EXT_extended_dynamic_state
    void vkCmdSetScissorWithCountEXT(
        VkCommandBuffer                             commandBuffer,
        uint32_t                                    scissorCount,
        const VkRect2D*                             pScissors);

## Parameters

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

## Description

This command sets the scissor count and scissor rectangular bounds state for subsequence drawing commands 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-scissorCount-03397
  `scissorCount` must be between `1` and `VkPhysicalDeviceLimits`::`maxViewports`, inclusive

- VUID-vkCmdSetScissorWithCount-scissorCount-03398
  If the multiple viewports 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`

- VUID-vkCmdSetScissorWithCount-commandBuffer-04820
  `commandBuffer` must not have VkCommandBufferInheritanceViewportScissorInfoNV::`viewportScissor2D` enabled

Valid Usage (Implicit)

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

- VUID-vkCmdSetScissorWithCount-pScissors-parameter
  `pScissors` must be a valid pointer to an array of `scissorCount` VkRect2D structures

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

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

- VUID-vkCmdSetScissorWithCount-scissorCount-arraylength
  `scissorCount` must be greater than `0`

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 | Supported Queue Types
--- | --- | ---
Primary Secondary | Both | Graphics

## See Also

VK_EXT_extended_dynamic_state, VK_VERSION_1_3, VkCommandBuffer, VkRect2D

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

SPDX-License-Identifier: CC-BY-4.0