VKCMDSETSTENCILWRITE(3)

NAME
vkCmdSetStencilWriteMask - Set the stencil write mask dynamic state.

C SPECIFICATION

    void vkCmdSetStencilWriteMask(
        VkCommandBuffer                             commandBuffer,
        VkStencilFaceFlags                          faceMask,
        uint32_t                                    writeMask);

PARAMETERS

commandBuffer
    The command buffer into which to insert the command.

faceMask
    The face or faces to which the new mask is to apply.

writeMask
    The new value to use for the stencil compare mask.

DESCRIPTION

vkCmdSetStencilWriteMask sets the mask value used for stencil writes on the command buffer specified by commandBuffer to writeMask. faceMask specifies the face or faces to which the new values are applied. It a bitmask comprised of members of the VkStencilFaceFlagBits enumeration, the definition of which is:

    typedef enum VkStencilFaceFlagBits {
        VK_STENCIL_FACE_FRONT_BIT = 0x00000001,
        VK_STENCIL_FACE_BACK_BIT = 0x00000002,
        VK_STENCIL_FRONT_AND_BACK = 0x00000003,
    } VkStencilFaceFlagBits;

The graphics pipeline bound to commandBuffer must have the VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled. When a pipeline that does not have VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled is first bound, the value of the stencil write mask is taken from the pipeline and attempts to change it using vkCmdSetStencilWriteMask results in undefined behavior. When a pipeline does have VK_DYNAMIC_STATE_STENCIL_WRITE_MASK dynamic state enabled is bound, the current value of the stencil write mask becomes undefined and must be set using a call to vkCmdSetStencilWriteMask.

If the stencil test is disabled in the current graphics pipeline, then the value of the stencil write mask is ignored.

VALID USAGE

    • commandBuffer must be a valid VkCommandBuffer handle

    • faceMask must be a valid combination of VkStencilFaceFlagBits values

    • faceMask must not be 0

    • commandBuffer must be in the recording state

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

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, vkCmdSetStencilCompareMask, vkCmdSetStencilReference, 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.