1 .. _depth,stencil,&alpha: 2 3 Depth, Stencil, & Alpha 4 ======================= 5 6 These three states control the depth, stencil, and alpha tests, used to 7 discard fragments that have passed through the fragment shader. 8 9 Traditionally, these three tests have been clumped together in hardware, so 10 they are all stored in one structure. 11 12 During actual execution, the order of operations done on fragments is always: 13 14 * Alpha 15 * Stencil 16 * Depth 17 18 Depth Members 19 ------------- 20 21 enabled 22 Whether the depth test is enabled. 23 writemask 24 Whether the depth buffer receives depth writes. 25 func 26 The depth test function. One of PIPE_FUNC. 27 28 Stencil Members 29 --------------- 30 31 enabled 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. 35 func 36 The stencil test function. One of PIPE_FUNC. 37 valuemask 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. 40 writemask 41 Stencil test writemask; this controls which bits of the stencil buffer 42 are written. 43 fail_op 44 The operation to carry out if the stencil test fails. One of 45 PIPE_STENCIL_OP. 46 zfail_op 47 The operation to carry out if the stencil test passes but the depth test 48 fails. One of PIPE_STENCIL_OP. 49 zpass_op 50 The operation to carry out if the stencil test and depth test both pass. 51 One of PIPE_STENCIL_OP. 52 53 Alpha Members 54 ------------- 55 56 enabled 57 Whether the alpha test is enabled. 58 func 59 The alpha test function. One of PIPE_FUNC. 60 ref_value 61 Alpha test reference value; used for certain functions. 62