Vulkan-Docs/doc/specs/vulkan/man/VkStencilOp.txt

85 lines
2.9 KiB
Plaintext

// Copyright (c) 2014-2016 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
VkStencilOp(3)
==============
Name
----
VkStencilOp - stencil comparison function
C Specification
---------------
// refBegin VkStencilOp stencil comparison function
As described earlier, the pname:failOp, pname:passOp, and pname:depthFailOp
members of slink:VkStencilOpState indicate what happens to the stored
stencil value if this or certain subsequent tests fail or pass. Each enum is
of type elink:VkStencilOp, which is defined as:
include::../api/enums/VkStencilOp.txt[]
Description
-----------
The possible values are:
* ename:VK_STENCIL_OP_KEEP keeps the current value.
* ename:VK_STENCIL_OP_ZERO sets the value to 0.
* ename:VK_STENCIL_OP_REPLACE sets the value to pname:reference.
* ename:VK_STENCIL_OP_INCREMENT_AND_CLAMP increments the current value and
clamps to the maximum representable unsigned value.
* ename:VK_STENCIL_OP_DECREMENT_AND_CLAMP decrements the current value and
clamps to 0.
* ename:VK_STENCIL_OP_INVERT bitwise-inverts the current value.
* ename:VK_STENCIL_OP_INCREMENT_AND_WRAP increments the current value and
wraps to 0 when the maximum value would have been exceeded.
* ename:VK_STENCIL_OP_DECREMENT_AND_WRAP decrements the current value and
wraps to the maximum possible value when the value would go below 0.
For purposes of increment and decrement, the stencil bits are considered as
an unsigned integer.
If the stencil test fails, the sample's coverage bit is cleared in the
fragment. If there is no stencil framebuffer attachment, stencil
modification cannot: occur, and it is as if the stencil tests always pass.
If the stencil test passes, the pname:writeMask member of the
slink:VkStencilOpState structures controls how the updated stencil value is
written to the stencil framebuffer attachment.
The least significant latexmath:[$s$] bits of pname:writeMask, where
latexmath:[$s$] is the number of bits in the stencil framebuffer attachment,
specify an integer mask. Where a latexmath:[$1$] appears in this mask, the
corresponding bit in the stencil value in the depth/stencil attachment is
written; where a latexmath:[$0$] appears, the bit is not written. The
pname:writeMask value uses either the front-facing or back-facing state
based on the facing-ness of the fragment. Fragments generated by
front-facing primitives use the front mask and fragments generated by
back-facing primitives use the back mask.
// refEnd VkStencilOp
See Also
--------
slink:VkStencilOpState
Document Notes
--------------
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkStencilOp
This page is extracted from the Vulkan Specification.
Fixes and changes should be made to the Specification,not directly.
include::footer.txt[]