VKCMDSETSCISSOR(3)

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

C SPECIFICATION

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

PARAMETERS

commandBuffer
    The command buffer into which to insert the command.

scissorCount
    The number of scissor rectangles to update.

pScissors
    A pointer to an array of structures defining the new scissor rectangles.

DESCRIPTION

vkCmdSetScissor sets the dynamic scissor state on the command buffer specified in commandBuffer. scissorCount specifies the number of scissor rectangles to update and pname;pScissors is pointer to an array of VkRect2D structures defining the new scissor rectangles. The definition of VkRect2D is:

    typedef struct VkRect2D {
        VkOffset2D    offset;
        VkExtent2D    extent;
    } VkRect2D;

The offset and extent members of VkRect2D specify the origin and size of the scissor rectangle, respectively. The rectangles numbered zero through scissorCount are updated and any remaining scissor rectangles become undefined.

The graphics pipeline bound to commandBuffer must have the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled. When a pipeline that does not have VK_DYNAMIC_STATE_SCISSOR dynamic state enabled is first bound, the origins and extents are taken from the pipeline and attempts to change them using vkCmdSetScissor results in undefined behavior. When a pipeline does have VK_DYNAMIC_STATE_SCISSOR dynamic state enabled is first bound, the current values of the scissor rectangle origins and extents become undefined and must be set using a call to vkCmdSetScissor.

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

    • 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

vkCreateGraphicsPipelines, VkPipelineDynamicStateCreateInfo

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.