| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
impeller::ColorAttachmentDescriptor Struct Reference

Describe the color attachment that will be used with this pipeline. More...

`#include <formats.h>`

## Public Member Functions
constexpr bool | operator== (const ColorAttachmentDescriptor &o) const
constexpr size_t | Hash () const

## Public Attributes
PixelFormat | format = PixelFormat::kUnknown
bool | blending_enabled = false
BlendFactor | src_color_blend_factor = BlendFactor::kSourceAlpha
BlendOperation | color_blend_op = BlendOperation::kAdd
BlendFactor | dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha
BlendFactor | src_alpha_blend_factor = BlendFactor::kSourceAlpha
BlendOperation | alpha_blend_op = BlendOperation::kAdd
BlendFactor | dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha
ColorWriteMask | write_mask = ColorWriteMaskBits::kAll

## Detailed Description

Describe the color attachment that will be used with this pipeline.

Blending at specific color attachments follows the pseudo-code:

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.

Definition at line 512 of file formats.h.

## Member Function Documentation

## ◆ Hash()

constexpr size_t impeller::ColorAttachmentDescriptor::Hash | ( |  | ) | const
| inline constexpr

Definition at line 538 of file formats.h.

538 {
539 return fml::HashCombine(
540 format, blending_enabled, src_color_blend_factor, color_blend_op,
541 dst_color_blend_factor, src_alpha_blend_factor, alpha_blend_op,
542 dst_alpha_blend_factor, static_cast<uint64_t>(write_mask));
543 }

References alpha_blend_op, blending_enabled, color_blend_op, dst_alpha_blend_factor, dst_color_blend_factor, format, src_alpha_blend_factor, src_color_blend_factor, and write_mask.

## ◆ operator==()

constexpr bool impeller::ColorAttachmentDescriptor::operator== | ( | const ColorAttachmentDescriptor & | o | ) | const
| inline constexpr

Definition at line 526 of file formats.h.

526 {
527 return format == o.format && //
528 blending_enabled == o.blending_enabled && //
529 src_color_blend_factor == o.src_color_blend_factor && //
530 color_blend_op == o.color_blend_op && //
531 dst_color_blend_factor == o.dst_color_blend_factor && //
532 src_alpha_blend_factor == o.src_alpha_blend_factor && //
533 alpha_blend_op == o.alpha_blend_op && //
534 dst_alpha_blend_factor == o.dst_alpha_blend_factor && //
535 write_mask == o.write_mask;
536 }

References alpha_blend_op, blending_enabled, color_blend_op, dst_alpha_blend_factor, dst_color_blend_factor, format, src_alpha_blend_factor, src_color_blend_factor, and write_mask.

## Member Data Documentation

## ◆ alpha_blend_op

BlendOperation impeller::ColorAttachmentDescriptor::alpha_blend_op = BlendOperation::kAdd

Definition at line 521 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ blending_enabled

bool impeller::ColorAttachmentDescriptor::blending_enabled = false

Definition at line 514 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), impeller::PipelineBuilder< VertexShader_, FragmentShader_ >::InitializePipelineDescriptorDefaults(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ color_blend_op

BlendOperation impeller::ColorAttachmentDescriptor::color_blend_op = BlendOperation::kAdd

Definition at line 517 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ dst_alpha_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha

Definition at line 522 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ dst_color_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::dst_color_blend_factor = BlendFactor::kOneMinusSourceAlpha

Definition at line 518 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ format

PixelFormat impeller::ColorAttachmentDescriptor::format = PixelFormat::kUnknown

Definition at line 513 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), impeller::PipelineBuilder< VertexShader_, FragmentShader_ >::InitializePipelineDescriptorDefaults(), operator==(), impeller::testing::TEST_P(), and impeller::ToMTLRenderPipelineColorAttachmentDescriptor().

## ◆ src_alpha_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::src_alpha_blend_factor = BlendFactor::kSourceAlpha

Definition at line 520 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ src_color_blend_factor

BlendFactor impeller::ColorAttachmentDescriptor::src_color_blend_factor = BlendFactor::kSourceAlpha

Definition at line 516 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

## ◆ write_mask

ColorWriteMask impeller::ColorAttachmentDescriptor::write_mask = ColorWriteMaskBits::kAll

Definition at line 524 of file formats.h.

Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), Hash(), operator==(), impeller::ToMTLRenderPipelineColorAttachmentDescriptor(), and impeller::ToVKPipelineColorBlendAttachmentState().

The documentation for this struct was generated from the following file:

- impeller/core/formats.h

impeller::ColorAttachmentDescriptor::src_color_blend_factor
BlendFactor src_color_blend_factor
Definition: formats.h:516
impeller::ColorAttachmentDescriptor::alpha_blend_op
BlendOperation alpha_blend_op
Definition: formats.h:521
impeller::ColorAttachmentDescriptor::format
PixelFormat format
Definition: formats.h:513
impeller::ColorAttachmentDescriptor::src_alpha_blend_factor
BlendFactor src_alpha_blend_factor
Definition: formats.h:520
impeller::ColorAttachmentDescriptor::dst_color_blend_factor
BlendFactor dst_color_blend_factor
Definition: formats.h:518
impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor
BlendFactor dst_alpha_blend_factor
Definition: formats.h:522
impeller::ColorAttachmentDescriptor::color_blend_op
BlendOperation color_blend_op
Definition: formats.h:517
impeller::ColorAttachmentDescriptor::blending_enabled
bool blending_enabled
Definition: formats.h:514
impeller::ColorAttachmentDescriptor::write_mask
ColorWriteMask write_mask
Definition: formats.h:524