From c6a811e2e58862529a00adc0daf15a8413a2f898 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 11 Jun 2024 19:14:00 -0700 Subject: [PATCH] [Impeller] disabling the color write mask seems to improve performance on iOS compared to just the blend options. (flutter/engine#53322) Otherwise should be semantically equivalent/no-op. --- engine/src/flutter/impeller/entity/contents/content_context.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/src/flutter/impeller/entity/contents/content_context.cc b/engine/src/flutter/impeller/entity/contents/content_context.cc index dc8985bb5a..35d51c4795 100644 --- a/engine/src/flutter/impeller/entity/contents/content_context.cc +++ b/engine/src/flutter/impeller/entity/contents/content_context.cc @@ -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; switch (pipeline_blend) { case BlendMode::kClear: @@ -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; break; case BlendMode::kSourceOver: color0.dst_alpha_blend_factor = BlendFactor::kOneMinusSourceAlpha;