VKCMDSETSCISSOR(3)

NAME
vkCmdSetScissor - Set the dynamic scissor rectangles on a command buffer.

C SPECIFICATION

The scissor test determines if a fragment’s framebuffer coordinates [ $(x_f,y_f)$ ] lie within the scissor rectangle corresponding to the viewport index (see Controlling the Viewport) used by the primitive that generated the fragment. If the pipeline state object is created without VK_DYNAMIC_STATE_SCISSOR enabled then the scissor rectangles are set by the VkPipelineViewportStateCreateInfo state of the pipeline state object. Otherwise, to dynamically set the scissor rectangles call:

    void vkCmdSetScissor(
        VkCommandBuffer                             commandBuffer,
        uint32_t                                    firstScissor,
        uint32_t                                    scissorCount,
        const VkRect2D*                             pScissors);

PARAMETERS

    • commandBuffer is the command buffer into which the command will be recorded.

    • firstScissor is the index of the first scissor whose state is updated by the command.

    • scissorCount is the number of scissors whose rectangles are updated by the command.

    • pScissors is a pointer to an array of VkRect2D structures defining scissor rectangles.

DESCRIPTION

The scissor rectangles taken from element [ $i$ ] of pScissors replace the current state for the scissor index [ $thit{firstScissor}+i$ ], for [ $i$ ] in [ $[0, scissorCount)$ ].

Each scissor rectangle is described by a VkRect2D structure, with the offset.x and offset.y values determining the upper left corner of the scissor rectangle, and the extent.width and extent.height values determining the size in pixels.

VALID USAGE

    • commandBuffer must be a valid VkCommandBuffer handle

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

    • commandBuffer must be in the recording state

    • The VkCommandPool that commandBuffer was allocated from must support graphics operations

    • scissorCount must be greater than 0

    • The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled

    • firstScissor must be less than VkPhysicalDeviceLimits::maxViewports

    • The sum of firstScissor and scissorCount must be between 1 and VkPhysicalDeviceLimits::maxViewports, inclusive

    • The x and y members of offset must be greater than or equal to 0

    • Evaluation of (offset.x + extent.width) must not cause a signed integer addition overflow

    • Evaluation of (offset.y + extent.height) must not cause a signed integer addition overflow

HOST SYNCHRONIZATION

    • Host access to commandBuffer must be externally synchronized

COMMAND PROPERTIES
Command Buffer Levels | Render Pass Scope | Supported Queue Types
Primary Secondary | Both | GRAPHICS

SEE ALSO

VkCommandBuffer, VkRect2D

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdSetScissor

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.