Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] disabling the color write mask seems to improve performance on iOS compared to just the blend options. #53322

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions impeller/entity/contents/content_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void ContentContextOptions::ApplyToPipelineDescriptor(
color0.format = color_attachment_pixel_format;
color0.alpha_blend_op = BlendOperation::kAdd;
color0.color_blend_op = BlendOperation::kAdd;
color0.write_mask = ColorWriteMaskBits::kAll;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just explicitly specifying the default value of the write mask as initialized in the ColorAttachmentDescriptor. Are there cases where we do modify it mask when we create the pipeline descriptor? Perhaps its better to be explicit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just being explicit.


switch (pipeline_blend) {
case BlendMode::kClear:
Expand Down Expand Up @@ -69,6 +70,7 @@ void ContentContextOptions::ApplyToPipelineDescriptor(
color0.dst_color_blend_factor = BlendFactor::kOne;
color0.src_alpha_blend_factor = BlendFactor::kZero;
color0.src_color_blend_factor = BlendFactor::kZero;
color0.write_mask = ColorWriteMaskBits::kNone;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it makes sense that this is correct. Have no clue why it could be faster. RSLGTM?

break;
case BlendMode::kSourceOver:
color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;
Expand Down