gallium/docs: document alpha_to_coverage and alpha_to_one blend state
[mesa.git] / src / gallium / docs / source / cso / blend.rst
index d97e3d32e9299de631f28273e986f8d6632bd9ac..7316e5c71cf66a90204d8e014b832cb1775bbce8 100644 (file)
@@ -12,7 +12,11 @@ Blend Factors
 The blend factors largely follow the same pattern as their counterparts
 in other modern and legacy drawing APIs.
 
-XXX blurb about dual-source blends
+Dual source blend factors are supported for up to 1 MRT, although
+you can advertise > 1 MRT, the stack cannot handle them for a few reasons.
+There is no definition on how the 1D array of shader outputs should be mapped
+to something that would be a 2D array (location, index). No current hardware
+exposes > 1 MRT, and we should revisit this issue if anyone ever does.
 
 Logical Operations
 ------------------
@@ -20,9 +24,11 @@ Logical Operations
 Logical operations, also known as logicops, lops, or rops, are supported.
 Only two-operand logicops are available. When logicops are enabled, all other
 blend state is ignored, including per-render-target state, so logicops are
-performed on all enabled render targets.
+performed on all render targets.
 
-XXX do lops still apply if blend_enable isn't set?
+.. warning::
+   The blend_enable flag is ignored for all render targets when logical
+   operations are enabled.
 
 For a source component `s` and destination component `d`, the logical
 operations are defined as taking the bits of each channel of each component,
@@ -82,6 +88,18 @@ independent_blend_enable
    the first member of the rt array contains valid data.
 rt
    Contains the per-rendertarget blend state.
+alpha_to_coverage
+   If enabled, the fragment's alpha value is used to override the fragment's
+   coverage mask.  The coverage mask will be all zeros if the alpha value is
+   zero.  The coverage mask will be all ones if the alpha value is one.
+   Otherwise, the number of bits set in the coverage mask will be proportional
+   to the alpha value.  Note that this step happens regardless of whether
+   multisample is enabled or the destination buffer is multisampled.
+alpha_to_one
+   If enabled, the fragment's alpha value will be set to one.  As with
+   alpha_to_coverage, this step happens regardless of whether multisample
+   is enabled or the destination buffer is multisampled.
+
 
 Per-rendertarget Members
 ------------------------