1 .. _depth,stencil,&alpha:
3 Depth, Stencil, & Alpha
4 =======================
6 These three states control the depth, stencil, and alpha tests, used to
7 discard fragments that have passed through the fragment shader.
9 Traditionally, these three tests have been clumped together in hardware, so
10 they are all stored in one structure.
12 During actual execution, the order of operations done on fragments is always:
22 Whether the depth test is enabled.
24 Whether the depth buffer receives depth writes.
26 The depth test function. One of PIPE_FUNC.
32 Whether the stencil test is enabled. For the second stencil, whether the
33 two-sided stencil is enabled. If two-sided stencil is disabled, the other
34 fields for the second array member are not valid.
36 The stencil test function. One of PIPE_FUNC.
38 Stencil test value mask; this is ANDed with the value in the stencil
39 buffer and the reference value before doing the stencil comparison test.
41 Stencil test writemask; this controls which bits of the stencil buffer
44 The operation to carry out if the stencil test fails. One of
47 The operation to carry out if the stencil test passes but the depth test
48 fails. One of PIPE_STENCIL_OP.
50 The operation to carry out if the stencil test and depth test both pass.
51 One of PIPE_STENCIL_OP.
57 Whether the alpha test is enabled.
59 The alpha test function. One of PIPE_FUNC.
61 Alpha test reference value; used for certain functions.