Add docstring to PipelineColorAttachment.

This commit is contained in:
Chinmay Garde 2021-08-21 19:35:12 -07:00 committed by Dan Field
parent ad383b44d4
commit f372fe5305

View File

@ -159,28 +159,32 @@ constexpr size_t BytesPerPixelForPixelFormat(PixelFormat format) {
return 0u;
}
//------------------------------------------------------------------------------
/// @brief Describe the color attachment that will be used with this
/// pipeline.
///
/// Blending at specific color attachments follows the pseudocode:
/// ```
/// if (blending_enabled) {
/// final_color.rgb = (src_color_blend_factor * new_color.rgb)
/// <color_blend_op>
/// (dst_color_blend_factor * old_color.rgb);
/// final_color.a = (src_alpha_blend_factor * new_color.a)
/// <alpha_blend_op>
/// (dst_alpha_blend_factor * old_color.a);
/// } else {
/// final_color = new_color;
/// }
/// // IMPORTANT: The write mask is applied irrespective of whether
/// // blending_enabled is set.
/// final_color = final_color & write_mask;
/// ```
///
/// The default blend mode is 1 - source alpha.
struct PipelineColorAttachment {
PixelFormat format = PixelFormat::kUnknown;
bool blending_enabled = false;
//----------------------------------------------------------------------------
/// Blending at specific color attachments follows the pseudocode:
/// ```
/// if (blending_enabled) {
/// final_color.rgb = (src_color_blend_factor * new_color.rgb)
/// <color_blend_op>
/// (dst_color_blend_factor * old_color.rgb);
/// final_color.a = (src_alpha_blend_factor * new_color.a)
/// <alpha_blend_op>
/// (dst_alpha_blend_factor * old_color.a);
/// } else {
/// final_color = new_color;
/// }
/// // IMPORTANT: The write mask is applied irrespective of whether
/// // blending_enabled is set.
/// final_color = final_color & write_mask;
/// ```
BlendFactor src_color_blend_factor = BlendFactor::kSourceAlpha;
BlendOperation color_blend_op = BlendOperation::kAdd;
BlendFactor dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha;