6 This state controls blending of the final fragments into the target rendering
12 The blend factors largely follow the same pattern as their counterparts
13 in other modern and legacy drawing APIs.
15 XXX blurb about dual-source blends
20 Logical operations, also known as logicops, lops, or rops, are supported.
21 Only two-operand logicops are available. When logicops are enabled, all other
22 blend state is ignored, including per-render-target state, so logicops are
23 performed on all render targets.
26 The blend_enable flag is ignored for all render targets when logical
27 operations are enabled.
29 For a source component `s` and destination component `d`, the logical
30 operations are defined as taking the bits of each channel of each component,
31 and performing one of the following operations per-channel:
34 * ``NOR``: :math:`\lnot(s \lor d)`
35 * ``AND_INVERTED``: :math:`\lnot s \land d`
36 * ``COPY_INVERTED``: :math:`\lnot s`
37 * ``AND_REVERSE``: :math:`s \land \lnot d`
38 * ``INVERT``: :math:`\lnot d`
39 * ``XOR``: :math:`s \oplus d`
40 * ``NAND``: :math:`\lnot(s \land d)`
41 * ``AND``: :math:`s \land d`
42 * ``EQUIV``: :math:`\lnot(s \oplus d)`
44 * ``OR_INVERTED``: :math:`\lnot s \lor d`
46 * ``OR_REVERSE``: :math:`s \lor \lnot d`
47 * ``OR``: :math:`s \lor d`
51 The logical operation names and definitions match those of the OpenGL API,
52 and are similar to the ROP2 and ROP3 definitions of GDI. This is
53 intentional, to ease transitions to Gallium.
58 These members affect all render targets.
63 Whether dithering is enabled.
66 Dithering is completely implementation-dependent. It may be ignored by
67 drivers for any reason, and some render targets may always or never be
68 dithered depending on their format or usage flags.
73 Whether the blender should perform a logicop instead of blending.
78 The logicop to use. One of ``PIPE_LOGICOP``.
80 independent_blend_enable
81 If enabled, blend state is different for each render target, and
82 for each render target set in the respective member of the rt array.
83 If disabled, blend state is the same for all render targets, and only
84 the first member of the rt array contains valid data.
86 Contains the per-rendertarget blend state.
88 Per-rendertarget Members
89 ------------------------
92 If blending is enabled, perform a blend calculation according to blend
93 functions and source/destination factors. Otherwise, the incoming fragment
94 color gets passed unmodified (but colormask still applies).
96 The blend function to use for rgb channels. One of PIPE_BLEND.
98 The blend source factor to use for rgb channels. One of PIPE_BLENDFACTOR.
100 The blend destination factor to use for rgb channels. One of PIPE_BLENDFACTOR.
102 The blend function to use for the alpha channel. One of PIPE_BLEND.
104 The blend source factor to use for the alpha channel. One of PIPE_BLENDFACTOR.
106 The blend destination factor to use for alpha channel. One of PIPE_BLENDFACTOR.
108 Bitmask of which channels to write. Combination of PIPE_MASK bits.