Flutter Impeller
content_context.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #include <memory>
8 #include <utility>
9 
10 #include "fml/trace_event.h"
12 #include "impeller/core/formats.h"
17 #include "impeller/entity/entity.h"
26 
27 namespace impeller {
28 
29 namespace {
30 
31 /// A generic version of `Variants` which mostly exists to reduce code size.
32 class GenericVariants {
33  public:
34  void Set(const ContentContextOptions& options,
35  std::unique_ptr<GenericRenderPipelineHandle> pipeline) {
36  uint64_t p_key = options.ToKey();
37  for (const auto& [key, pipeline] : pipelines_) {
38  if (key == p_key) {
39  return;
40  }
41  }
42  pipelines_.push_back(std::make_pair(p_key, std::move(pipeline)));
43  }
44 
45  void SetDefault(const ContentContextOptions& options,
46  std::unique_ptr<GenericRenderPipelineHandle> pipeline) {
47  default_options_ = options;
48  if (pipeline) {
49  Set(options, std::move(pipeline));
50  }
51  }
52 
53  GenericRenderPipelineHandle* Get(const ContentContextOptions& options) const {
54  uint64_t p_key = options.ToKey();
55  for (const auto& [key, pipeline] : pipelines_) {
56  if (key == p_key) {
57  return pipeline.get();
58  }
59  }
60  return nullptr;
61  }
62 
63  void SetDefaultDescriptor(std::optional<PipelineDescriptor> desc) {
64  desc_ = std::move(desc);
65  }
66 
67  size_t GetPipelineCount() const { return pipelines_.size(); }
68 
69  bool IsDefault(const ContentContextOptions& opts) {
70  return default_options_.has_value() &&
71  opts.ToKey() == default_options_.value().ToKey();
72  }
73 
74  protected:
75  std::optional<PipelineDescriptor> desc_;
76  std::optional<ContentContextOptions> default_options_;
77  std::vector<std::pair<uint64_t, std::unique_ptr<GenericRenderPipelineHandle>>>
79 };
80 
81 /// Holds multiple Pipelines associated with the same PipelineHandle types.
82 ///
83 /// For example, it may have multiple
84 /// RenderPipelineHandle<SolidFillVertexShader, SolidFillFragmentShader>
85 /// instances for different blend modes. From them you can access the
86 /// Pipeline.
87 ///
88 /// See also:
89 /// - impeller::ContentContextOptions - options from which variants are
90 /// created.
91 /// - impeller::Pipeline::CreateVariant
92 /// - impeller::RenderPipelineHandle<> - The type of objects this typically
93 /// contains.
94 template <class PipelineHandleT>
95 class Variants : public GenericVariants {
96  static_assert(
97  ShaderStageCompatibilityChecker<
98  typename PipelineHandleT::VertexShader,
99  typename PipelineHandleT::FragmentShader>::Check(),
100  "The output slots for the fragment shader don't have matches in the "
101  "vertex shader's output slots. This will result in a linker error.");
102 
103  public:
104  Variants() = default;
105 
106  void Set(const ContentContextOptions& options,
107  std::unique_ptr<PipelineHandleT> pipeline) {
108  GenericVariants::Set(options, std::move(pipeline));
109  }
110 
111  void SetDefault(const ContentContextOptions& options,
112  std::unique_ptr<PipelineHandleT> pipeline) {
113  GenericVariants::SetDefault(options, std::move(pipeline));
114  }
115 
116  void CreateDefault(const Context& context,
117  const ContentContextOptions& options,
118  const std::vector<Scalar>& constants = {}) {
119  std::optional<PipelineDescriptor> desc =
120  PipelineHandleT::Builder::MakeDefaultPipelineDescriptor(context,
121  constants);
122  if (!desc.has_value()) {
123  VALIDATION_LOG << "Failed to create default pipeline.";
124  return;
125  }
126  options.ApplyToPipelineDescriptor(*desc);
127  desc_ = desc;
128  if (context.GetFlags().lazy_shader_mode) {
129  SetDefault(options, nullptr);
130  } else {
131  SetDefault(options, std::make_unique<PipelineHandleT>(context, desc_,
132  /*async=*/true));
133  }
134  }
135 
136  PipelineHandleT* Get(const ContentContextOptions& options) const {
137  return static_cast<PipelineHandleT*>(GenericVariants::Get(options));
138  }
139 
140  PipelineHandleT* GetDefault(const Context& context) {
141  if (!default_options_.has_value()) {
142  return nullptr;
143  }
144  PipelineHandleT* result = Get(default_options_.value());
145  if (result != nullptr) {
146  return result;
147  }
148  SetDefault(default_options_.value(), std::make_unique<PipelineHandleT>(
149  context, desc_, /*async=*/false));
150  return Get(default_options_.value());
151  }
152 
153  private:
154  Variants(const Variants&) = delete;
155 
156  Variants& operator=(const Variants&) = delete;
157 };
158 
159 template <class RenderPipelineHandleT>
160 RenderPipelineHandleT* CreateIfNeeded(
161  const ContentContext* context,
162  Variants<RenderPipelineHandleT>& container,
163  ContentContextOptions opts) {
164  if (!context->IsValid()) {
165  return nullptr;
166  }
167 
168  if (RenderPipelineHandleT* found = container.Get(opts)) {
169  return found;
170  }
171 
172  RenderPipelineHandleT* default_handle =
173  container.GetDefault(*context->GetContext());
174  if (container.IsDefault(opts)) {
175  return default_handle;
176  }
177 
178  // The default must always be initialized in the constructor.
179  FML_CHECK(default_handle != nullptr);
180 
181  const std::shared_ptr<Pipeline<PipelineDescriptor>>& pipeline =
182  default_handle->WaitAndGet();
183  if (!pipeline) {
184  return nullptr;
185  }
186 
187  auto variant_future = pipeline->CreateVariant(
188  /*async=*/false, [&opts, variants_count = container.GetPipelineCount()](
189  PipelineDescriptor& desc) {
190  opts.ApplyToPipelineDescriptor(desc);
191  desc.SetLabel(
192  SPrintF("%s V#%zu", desc.GetLabel().data(), variants_count));
193  });
194  std::unique_ptr<RenderPipelineHandleT> variant =
195  std::make_unique<RenderPipelineHandleT>(std::move(variant_future));
196  container.Set(opts, std::move(variant));
197  return container.Get(opts);
198 }
199 
200 template <class TypedPipeline>
201 PipelineRef GetPipeline(const ContentContext* context,
202  Variants<TypedPipeline>& container,
203  ContentContextOptions opts) {
204  TypedPipeline* pipeline = CreateIfNeeded(context, container, opts);
205  if (!pipeline) {
206  return raw_ptr<Pipeline<PipelineDescriptor>>();
207  }
208  return raw_ptr(pipeline->WaitAndGet());
209 }
210 
211 } // namespace
212 
214  // clang-format off
215  Variants<BlendColorBurnPipeline> blend_colorburn;
216  Variants<BlendColorDodgePipeline> blend_colordodge;
217  Variants<BlendColorPipeline> blend_color;
218  Variants<BlendDarkenPipeline> blend_darken;
219  Variants<BlendDifferencePipeline> blend_difference;
220  Variants<BlendExclusionPipeline> blend_exclusion;
221  Variants<BlendHardLightPipeline> blend_hardlight;
222  Variants<BlendHuePipeline> blend_hue;
223  Variants<BlendLightenPipeline> blend_lighten;
224  Variants<BlendLuminosityPipeline> blend_luminosity;
225  Variants<BlendMultiplyPipeline> blend_multiply;
226  Variants<BlendOverlayPipeline> blend_overlay;
227  Variants<BlendSaturationPipeline> blend_saturation;
228  Variants<BlendScreenPipeline> blend_screen;
229  Variants<BlendSoftLightPipeline> blend_softlight;
230  Variants<BorderMaskBlurPipeline> border_mask_blur;
231  Variants<ClipPipeline> clip;
232  Variants<ColorMatrixColorFilterPipeline> color_matrix_color_filter;
233  Variants<ConicalGradientFillConicalPipeline> conical_gradient_fill;
234  Variants<ConicalGradientFillRadialPipeline> conical_gradient_fill_radial;
235  Variants<ConicalGradientFillStripPipeline> conical_gradient_fill_strip;
236  Variants<ConicalGradientFillStripRadialPipeline> conical_gradient_fill_strip_and_radial;
237  Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill;
238  Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_radial;
239  Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_strip_and_radial;
240  Variants<ConicalGradientSSBOFillPipeline> conical_gradient_ssbo_fill_strip;
241  Variants<ConicalGradientUniformFillConicalPipeline> conical_gradient_uniform_fill;
242  Variants<ConicalGradientUniformFillRadialPipeline> conical_gradient_uniform_fill_radial;
243  Variants<ConicalGradientUniformFillStripPipeline> conical_gradient_uniform_fill_strip;
244  Variants<ConicalGradientUniformFillStripRadialPipeline> conical_gradient_uniform_fill_strip_and_radial;
245  Variants<FastGradientPipeline> fast_gradient;
246  Variants<FramebufferBlendColorBurnPipeline> framebuffer_blend_colorburn;
247  Variants<FramebufferBlendColorDodgePipeline> framebuffer_blend_colordodge;
248  Variants<FramebufferBlendColorPipeline> framebuffer_blend_color;
249  Variants<FramebufferBlendDarkenPipeline> framebuffer_blend_darken;
250  Variants<FramebufferBlendDifferencePipeline> framebuffer_blend_difference;
251  Variants<FramebufferBlendExclusionPipeline> framebuffer_blend_exclusion;
252  Variants<FramebufferBlendHardLightPipeline> framebuffer_blend_hardlight;
253  Variants<FramebufferBlendHuePipeline> framebuffer_blend_hue;
254  Variants<FramebufferBlendLightenPipeline> framebuffer_blend_lighten;
255  Variants<FramebufferBlendLuminosityPipeline> framebuffer_blend_luminosity;
256  Variants<FramebufferBlendMultiplyPipeline> framebuffer_blend_multiply;
257  Variants<FramebufferBlendOverlayPipeline> framebuffer_blend_overlay;
258  Variants<FramebufferBlendSaturationPipeline> framebuffer_blend_saturation;
259  Variants<FramebufferBlendScreenPipeline> framebuffer_blend_screen;
260  Variants<FramebufferBlendSoftLightPipeline> framebuffer_blend_softlight;
261  Variants<GaussianBlurPipeline> gaussian_blur;
262  Variants<GlyphAtlasPipeline> glyph_atlas;
263  Variants<LinePipeline> line;
264  Variants<LinearGradientFillPipeline> linear_gradient_fill;
265  Variants<LinearGradientSSBOFillPipeline> linear_gradient_ssbo_fill;
266  Variants<LinearGradientUniformFillPipeline> linear_gradient_uniform_fill;
267  Variants<LinearToSrgbFilterPipeline> linear_to_srgb_filter;
268  Variants<MorphologyFilterPipeline> morphology_filter;
269  Variants<PorterDuffBlendPipeline> clear_blend;
270  Variants<PorterDuffBlendPipeline> destination_a_top_blend;
271  Variants<PorterDuffBlendPipeline> destination_blend;
272  Variants<PorterDuffBlendPipeline> destination_in_blend;
273  Variants<PorterDuffBlendPipeline> destination_out_blend;
274  Variants<PorterDuffBlendPipeline> destination_over_blend;
275  Variants<PorterDuffBlendPipeline> modulate_blend;
276  Variants<PorterDuffBlendPipeline> plus_blend;
277  Variants<PorterDuffBlendPipeline> screen_blend;
278  Variants<PorterDuffBlendPipeline> source_a_top_blend;
279  Variants<PorterDuffBlendPipeline> source_blend;
280  Variants<PorterDuffBlendPipeline> source_in_blend;
281  Variants<PorterDuffBlendPipeline> source_out_blend;
282  Variants<PorterDuffBlendPipeline> source_over_blend;
283  Variants<PorterDuffBlendPipeline> xor_blend;
284  Variants<RadialGradientFillPipeline> radial_gradient_fill;
285  Variants<RadialGradientSSBOFillPipeline> radial_gradient_ssbo_fill;
286  Variants<RadialGradientUniformFillPipeline> radial_gradient_uniform_fill;
287  Variants<RRectBlurPipeline> rrect_blur;
288  Variants<RSuperellipseBlurPipeline> rsuperellipse_blur;
289  Variants<SolidFillPipeline> solid_fill;
290  Variants<SrgbToLinearFilterPipeline> srgb_to_linear_filter;
291  Variants<SweepGradientFillPipeline> sweep_gradient_fill;
292  Variants<SweepGradientSSBOFillPipeline> sweep_gradient_ssbo_fill;
293  Variants<SweepGradientUniformFillPipeline> sweep_gradient_uniform_fill;
294  Variants<TextureDownsamplePipeline> texture_downsample;
295  Variants<TexturePipeline> texture;
296  Variants<TextureStrictSrcPipeline> texture_strict_src;
297  Variants<TiledTexturePipeline> tiled_texture;
298  Variants<VerticesUber1Shader> vertices_uber_1_;
299  Variants<VerticesUber2Shader> vertices_uber_2_;
300  Variants<YUVToRGBFilterPipeline> yuv_to_rgb_filter;
301 
302 #ifdef IMPELLER_ENABLE_OPENGLES
303  Variants<TiledTextureExternalPipeline> tiled_texture_external;
304  Variants<TextureDownsampleGlesPipeline> texture_downsample_gles;
305  Variants<TiledTextureUvExternalPipeline> tiled_texture_uv_external;
306 #endif // IMPELLER_ENABLE_OPENGLES
307  // clang-format on
308 };
309 
311  PipelineDescriptor& desc) const {
312  auto pipeline_blend = blend_mode;
314  VALIDATION_LOG << "Cannot use blend mode " << static_cast<int>(blend_mode)
315  << " as a pipeline blend.";
316  pipeline_blend = BlendMode::kSrcOver;
317  }
318 
320 
326 
327  switch (pipeline_blend) {
328  case BlendMode::kClear:
336  } else {
341  }
342  break;
343  case BlendMode::kSrc:
344  color0.blending_enabled = false;
349  break;
350  case BlendMode::kDst:
356  break;
357  case BlendMode::kSrcOver:
362  break;
363  case BlendMode::kDstOver:
368  break;
369  case BlendMode::kSrcIn:
374  break;
375  case BlendMode::kDstIn:
380  break;
381  case BlendMode::kSrcOut:
386  break;
387  case BlendMode::kDstOut:
392  break;
393  case BlendMode::kSrcATop:
398  break;
399  case BlendMode::kDstATop:
404  break;
405  case BlendMode::kXor:
410  break;
411  case BlendMode::kPlus:
416  break;
422  break;
423  default:
424  FML_UNREACHABLE();
425  }
426  desc.SetColorAttachmentDescriptor(0u, color0);
427 
429  desc.ClearDepthAttachment();
431  }
432 
433  auto maybe_stencil = desc.GetFrontStencilAttachmentDescriptor();
434  auto maybe_depth = desc.GetDepthStencilAttachmentDescriptor();
435  FML_DCHECK(has_depth_stencil_attachments == maybe_depth.has_value())
436  << "Depth attachment doesn't match expected pipeline state. "
437  "has_depth_stencil_attachments="
439  FML_DCHECK(has_depth_stencil_attachments == maybe_stencil.has_value())
440  << "Stencil attachment doesn't match expected pipeline state. "
441  "has_depth_stencil_attachments="
443  if (maybe_stencil.has_value()) {
444  StencilAttachmentDescriptor front_stencil = maybe_stencil.value();
445  StencilAttachmentDescriptor back_stencil = front_stencil;
446 
447  switch (stencil_mode) {
451  desc.SetStencilAttachmentDescriptors(front_stencil);
452  break;
454  // The stencil ref should be 0 on commands that use this mode.
459  desc.SetStencilAttachmentDescriptors(front_stencil, back_stencil);
460  break;
462  // The stencil ref should be 0 on commands that use this mode.
466  desc.SetStencilAttachmentDescriptors(front_stencil);
467  break;
469  // The stencil ref should be 0 on commands that use this mode.
471  front_stencil.depth_stencil_pass =
473  desc.SetStencilAttachmentDescriptors(front_stencil);
474  break;
476  // The stencil ref should be 0 on commands that use this mode.
479  desc.SetStencilAttachmentDescriptors(front_stencil);
480  break;
484  desc.SetStencilAttachmentDescriptors(front_stencil);
485  break;
487  front_stencil.stencil_compare = CompareFunction::kLess;
488  front_stencil.depth_stencil_pass =
490  desc.SetStencilAttachmentDescriptors(front_stencil);
491  break;
492  }
493  }
494  if (maybe_depth.has_value()) {
495  DepthAttachmentDescriptor depth = maybe_depth.value();
499  }
500 
503 }
504 
505 std::array<std::vector<Scalar>, 15> GetPorterDuffSpecConstants(
506  bool supports_decal) {
507  Scalar x = supports_decal ? 1 : 0;
508  return {{
509  {x, 0, 0, 0, 0, 0}, // Clear
510  {x, 1, 0, 0, 0, 0}, // Source
511  {x, 0, 0, 1, 0, 0}, // Destination
512  {x, 1, 0, 1, -1, 0}, // SourceOver
513  {x, 1, -1, 1, 0, 0}, // DestinationOver
514  {x, 0, 1, 0, 0, 0}, // SourceIn
515  {x, 0, 0, 0, 1, 0}, // DestinationIn
516  {x, 1, -1, 0, 0, 0}, // SourceOut
517  {x, 0, 0, 1, -1, 0}, // DestinationOut
518  {x, 0, 1, 1, -1, 0}, // SourceATop
519  {x, 1, -1, 0, 1, 0}, // DestinationATop
520  {x, 1, -1, 1, -1, 0}, // Xor
521  {x, 1, 0, 1, 0, 0}, // Plus
522  {x, 0, 0, 0, 0, 1}, // Modulate
523  {x, 0, 0, 1, 0, -1}, // Screen
524  }};
525 }
526 
527 template <typename PipelineT>
528 static std::unique_ptr<PipelineT> CreateDefaultPipeline(
529  const Context& context) {
530  auto desc = PipelineT::Builder::MakeDefaultPipelineDescriptor(context);
531  if (!desc.has_value()) {
532  return nullptr;
533  }
534  // Apply default ContentContextOptions to the descriptor.
535  const auto default_color_format =
536  context.GetCapabilities()->GetDefaultColorFormat();
538  .primitive_type = PrimitiveType::kTriangleStrip,
539  .color_attachment_pixel_format = default_color_format}
540  .ApplyToPipelineDescriptor(*desc);
541  return std::make_unique<PipelineT>(context, desc);
542 }
543 
545  std::shared_ptr<Context> context,
546  std::shared_ptr<TypographerContext> typographer_context,
547  std::shared_ptr<RenderTargetAllocator> render_target_allocator)
548  : context_(std::move(context)),
549  lazy_glyph_atlas_(
550  std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),
551  pipelines_(new Pipelines()),
552  tessellator_(std::make_shared<Tessellator>()),
553  render_target_cache_(render_target_allocator == nullptr
554  ? std::make_shared<RenderTargetCache>(
555  context_->GetResourceAllocator())
556  : std::move(render_target_allocator)),
557  host_buffer_(HostBuffer::Create(
558  context_->GetResourceAllocator(),
559  context_->GetIdleWaiter(),
560  context_->GetCapabilities()->GetMinimumUniformAlignment())),
561  text_shadow_cache_(std::make_unique<TextShadowCache>()) {
562  if (!context_ || !context_->IsValid()) {
563  return;
564  }
565 
566  {
567  TextureDescriptor desc;
570  desc.size = ISize{1, 1};
571  empty_texture_ = GetContext()->GetResourceAllocator()->CreateTexture(desc);
572 
573  std::array<uint8_t, 4> data = Color::BlackTransparent().ToR8G8B8A8();
574  std::shared_ptr<CommandBuffer> cmd_buffer =
575  GetContext()->CreateCommandBuffer();
576  std::shared_ptr<BlitPass> blit_pass = cmd_buffer->CreateBlitPass();
577  HostBuffer& host_buffer = GetTransientsBuffer();
578  BufferView buffer_view = host_buffer.Emplace(data);
579  blit_pass->AddCopy(buffer_view, empty_texture_);
580 
581  if (!blit_pass->EncodeCommands() || !GetContext()
582  ->GetCommandQueue()
583  ->Submit({std::move(cmd_buffer)})
584  .ok()) {
585  VALIDATION_LOG << "Failed to create empty texture.";
586  }
587  }
588 
589  auto options = ContentContextOptions{
591  .color_attachment_pixel_format =
592  context_->GetCapabilities()->GetDefaultColorFormat()};
593  auto options_trianglestrip = ContentContextOptions{
595  .primitive_type = PrimitiveType::kTriangleStrip,
596  .color_attachment_pixel_format =
597  context_->GetCapabilities()->GetDefaultColorFormat()};
598  auto options_no_msaa_no_depth_stencil = ContentContextOptions{
600  .primitive_type = PrimitiveType::kTriangleStrip,
601  .color_attachment_pixel_format =
602  context_->GetCapabilities()->GetDefaultColorFormat(),
603  .has_depth_stencil_attachments = false};
604  const auto supports_decal = static_cast<Scalar>(
605  context_->GetCapabilities()->SupportsDecalSamplerAddressMode());
606 
607  // Futures for the following pipelines may block in case the first frame is
608  // rendered without the pipelines being ready. Put pipelines that are more
609  // likely to be used first.
610  {
611  pipelines_->glyph_atlas.CreateDefault(
612  *context_, options,
613  {static_cast<Scalar>(
614  GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() ==
616  pipelines_->solid_fill.CreateDefault(*context_, options);
617  pipelines_->texture.CreateDefault(*context_, options);
618  pipelines_->fast_gradient.CreateDefault(*context_, options);
619  pipelines_->line.CreateDefault(*context_, options);
620 
621  if (context_->GetCapabilities()->SupportsSSBO()) {
622  pipelines_->linear_gradient_ssbo_fill.CreateDefault(*context_, options);
623  pipelines_->radial_gradient_ssbo_fill.CreateDefault(*context_, options);
624  pipelines_->conical_gradient_ssbo_fill.CreateDefault(*context_, options,
625  {3.0});
626  pipelines_->conical_gradient_ssbo_fill_radial.CreateDefault(
627  *context_, options, {1.0});
628  pipelines_->conical_gradient_ssbo_fill_strip.CreateDefault(
629  *context_, options, {2.0});
630  pipelines_->conical_gradient_ssbo_fill_strip_and_radial.CreateDefault(
631  *context_, options, {0.0});
632  pipelines_->sweep_gradient_ssbo_fill.CreateDefault(*context_, options);
633  } else {
634  pipelines_->linear_gradient_uniform_fill.CreateDefault(*context_,
635  options);
636  pipelines_->radial_gradient_uniform_fill.CreateDefault(*context_,
637  options);
638  pipelines_->conical_gradient_uniform_fill.CreateDefault(*context_,
639  options);
640  pipelines_->conical_gradient_uniform_fill_radial.CreateDefault(*context_,
641  options);
642  pipelines_->conical_gradient_uniform_fill_strip.CreateDefault(*context_,
643  options);
644  pipelines_->conical_gradient_uniform_fill_strip_and_radial.CreateDefault(
645  *context_, options);
646  pipelines_->sweep_gradient_uniform_fill.CreateDefault(*context_, options);
647 
648  pipelines_->linear_gradient_fill.CreateDefault(*context_, options);
649  pipelines_->radial_gradient_fill.CreateDefault(*context_, options);
650  pipelines_->conical_gradient_fill.CreateDefault(*context_, options);
651  pipelines_->conical_gradient_fill_radial.CreateDefault(*context_,
652  options);
653  pipelines_->conical_gradient_fill_strip.CreateDefault(*context_, options);
654  pipelines_->conical_gradient_fill_strip_and_radial.CreateDefault(
655  *context_, options);
656  pipelines_->sweep_gradient_fill.CreateDefault(*context_, options);
657  }
658 
659  /// Setup default clip pipeline.
660  auto clip_pipeline_descriptor =
662  if (!clip_pipeline_descriptor.has_value()) {
663  return;
664  }
667  .color_attachment_pixel_format =
668  context_->GetCapabilities()->GetDefaultColorFormat()}
669  .ApplyToPipelineDescriptor(*clip_pipeline_descriptor);
670  // Disable write to all color attachments.
671  auto clip_color_attachments =
672  clip_pipeline_descriptor->GetColorAttachmentDescriptors();
673  for (auto& color_attachment : clip_color_attachments) {
674  color_attachment.second.write_mask = ColorWriteMaskBits::kNone;
675  }
676  clip_pipeline_descriptor->SetColorAttachmentDescriptors(
677  std::move(clip_color_attachments));
678  if (GetContext()->GetFlags().lazy_shader_mode) {
679  pipelines_->clip.SetDefaultDescriptor(clip_pipeline_descriptor);
680  pipelines_->clip.SetDefault(options, nullptr);
681  } else {
682  pipelines_->clip.SetDefault(
683  options,
684  std::make_unique<ClipPipeline>(*context_, clip_pipeline_descriptor));
685  }
686  pipelines_->texture_downsample.CreateDefault(
687  *context_, options_no_msaa_no_depth_stencil);
688  pipelines_->rrect_blur.CreateDefault(*context_, options_trianglestrip);
689  pipelines_->rsuperellipse_blur.CreateDefault(*context_,
690  options_trianglestrip);
691  pipelines_->texture_strict_src.CreateDefault(*context_, options);
692  pipelines_->tiled_texture.CreateDefault(*context_, options,
693  {supports_decal});
694  pipelines_->gaussian_blur.CreateDefault(
695  *context_, options_no_msaa_no_depth_stencil, {supports_decal});
696  pipelines_->border_mask_blur.CreateDefault(*context_,
697  options_trianglestrip);
698  pipelines_->color_matrix_color_filter.CreateDefault(*context_,
699  options_trianglestrip);
700  pipelines_->vertices_uber_1_.CreateDefault(*context_, options,
701  {supports_decal});
702  pipelines_->vertices_uber_2_.CreateDefault(*context_, options,
703  {supports_decal});
704 
705  const std::array<std::vector<Scalar>, 15> porter_duff_constants =
706  GetPorterDuffSpecConstants(supports_decal);
707  pipelines_->clear_blend.CreateDefault(*context_, options_trianglestrip,
708  porter_duff_constants[0]);
709  pipelines_->source_blend.CreateDefault(*context_, options_trianglestrip,
710  porter_duff_constants[1]);
711  pipelines_->destination_blend.CreateDefault(
712  *context_, options_trianglestrip, porter_duff_constants[2]);
713  pipelines_->source_over_blend.CreateDefault(
714  *context_, options_trianglestrip, porter_duff_constants[3]);
715  pipelines_->destination_over_blend.CreateDefault(
716  *context_, options_trianglestrip, porter_duff_constants[4]);
717  pipelines_->source_in_blend.CreateDefault(*context_, options_trianglestrip,
718  porter_duff_constants[5]);
719  pipelines_->destination_in_blend.CreateDefault(
720  *context_, options_trianglestrip, porter_duff_constants[6]);
721  pipelines_->source_out_blend.CreateDefault(*context_, options_trianglestrip,
722  porter_duff_constants[7]);
723  pipelines_->destination_out_blend.CreateDefault(
724  *context_, options_trianglestrip, porter_duff_constants[8]);
725  pipelines_->source_a_top_blend.CreateDefault(
726  *context_, options_trianglestrip, porter_duff_constants[9]);
727  pipelines_->destination_a_top_blend.CreateDefault(
728  *context_, options_trianglestrip, porter_duff_constants[10]);
729  pipelines_->xor_blend.CreateDefault(*context_, options_trianglestrip,
730  porter_duff_constants[11]);
731  pipelines_->plus_blend.CreateDefault(*context_, options_trianglestrip,
732  porter_duff_constants[12]);
733  pipelines_->modulate_blend.CreateDefault(*context_, options_trianglestrip,
734  porter_duff_constants[13]);
735  pipelines_->screen_blend.CreateDefault(*context_, options_trianglestrip,
736  porter_duff_constants[14]);
737  }
738 
739  if (context_->GetCapabilities()->SupportsFramebufferFetch()) {
740  pipelines_->framebuffer_blend_color.CreateDefault(
741  *context_, options_trianglestrip,
742  {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
743  pipelines_->framebuffer_blend_colorburn.CreateDefault(
744  *context_, options_trianglestrip,
745  {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
746  pipelines_->framebuffer_blend_colordodge.CreateDefault(
747  *context_, options_trianglestrip,
748  {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
749  pipelines_->framebuffer_blend_darken.CreateDefault(
750  *context_, options_trianglestrip,
751  {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
752  pipelines_->framebuffer_blend_difference.CreateDefault(
753  *context_, options_trianglestrip,
754  {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
755  pipelines_->framebuffer_blend_exclusion.CreateDefault(
756  *context_, options_trianglestrip,
757  {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
758  pipelines_->framebuffer_blend_hardlight.CreateDefault(
759  *context_, options_trianglestrip,
760  {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
761  pipelines_->framebuffer_blend_hue.CreateDefault(
762  *context_, options_trianglestrip,
763  {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
764  pipelines_->framebuffer_blend_lighten.CreateDefault(
765  *context_, options_trianglestrip,
766  {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
767  pipelines_->framebuffer_blend_luminosity.CreateDefault(
768  *context_, options_trianglestrip,
769  {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
770  pipelines_->framebuffer_blend_multiply.CreateDefault(
771  *context_, options_trianglestrip,
772  {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
773  pipelines_->framebuffer_blend_overlay.CreateDefault(
774  *context_, options_trianglestrip,
775  {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
776  pipelines_->framebuffer_blend_saturation.CreateDefault(
777  *context_, options_trianglestrip,
778  {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
779  pipelines_->framebuffer_blend_screen.CreateDefault(
780  *context_, options_trianglestrip,
781  {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
782  pipelines_->framebuffer_blend_softlight.CreateDefault(
783  *context_, options_trianglestrip,
784  {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
785  } else {
786  pipelines_->blend_color.CreateDefault(
787  *context_, options_trianglestrip,
788  {static_cast<Scalar>(BlendSelectValues::kColor), supports_decal});
789  pipelines_->blend_colorburn.CreateDefault(
790  *context_, options_trianglestrip,
791  {static_cast<Scalar>(BlendSelectValues::kColorBurn), supports_decal});
792  pipelines_->blend_colordodge.CreateDefault(
793  *context_, options_trianglestrip,
794  {static_cast<Scalar>(BlendSelectValues::kColorDodge), supports_decal});
795  pipelines_->blend_darken.CreateDefault(
796  *context_, options_trianglestrip,
797  {static_cast<Scalar>(BlendSelectValues::kDarken), supports_decal});
798  pipelines_->blend_difference.CreateDefault(
799  *context_, options_trianglestrip,
800  {static_cast<Scalar>(BlendSelectValues::kDifference), supports_decal});
801  pipelines_->blend_exclusion.CreateDefault(
802  *context_, options_trianglestrip,
803  {static_cast<Scalar>(BlendSelectValues::kExclusion), supports_decal});
804  pipelines_->blend_hardlight.CreateDefault(
805  *context_, options_trianglestrip,
806  {static_cast<Scalar>(BlendSelectValues::kHardLight), supports_decal});
807  pipelines_->blend_hue.CreateDefault(
808  *context_, options_trianglestrip,
809  {static_cast<Scalar>(BlendSelectValues::kHue), supports_decal});
810  pipelines_->blend_lighten.CreateDefault(
811  *context_, options_trianglestrip,
812  {static_cast<Scalar>(BlendSelectValues::kLighten), supports_decal});
813  pipelines_->blend_luminosity.CreateDefault(
814  *context_, options_trianglestrip,
815  {static_cast<Scalar>(BlendSelectValues::kLuminosity), supports_decal});
816  pipelines_->blend_multiply.CreateDefault(
817  *context_, options_trianglestrip,
818  {static_cast<Scalar>(BlendSelectValues::kMultiply), supports_decal});
819  pipelines_->blend_overlay.CreateDefault(
820  *context_, options_trianglestrip,
821  {static_cast<Scalar>(BlendSelectValues::kOverlay), supports_decal});
822  pipelines_->blend_saturation.CreateDefault(
823  *context_, options_trianglestrip,
824  {static_cast<Scalar>(BlendSelectValues::kSaturation), supports_decal});
825  pipelines_->blend_screen.CreateDefault(
826  *context_, options_trianglestrip,
827  {static_cast<Scalar>(BlendSelectValues::kScreen), supports_decal});
828  pipelines_->blend_softlight.CreateDefault(
829  *context_, options_trianglestrip,
830  {static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
831  }
832 
833  pipelines_->morphology_filter.CreateDefault(*context_, options_trianglestrip,
834  {supports_decal});
835  pipelines_->linear_to_srgb_filter.CreateDefault(*context_,
836  options_trianglestrip);
837  pipelines_->srgb_to_linear_filter.CreateDefault(*context_,
838  options_trianglestrip);
839  pipelines_->yuv_to_rgb_filter.CreateDefault(*context_, options_trianglestrip);
840 
841 #if defined(IMPELLER_ENABLE_OPENGLES)
842  if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
843 #if !defined(FML_OS_MACOSX)
844  // GLES only shader that is unsupported on macOS.
845  pipelines_->tiled_texture_external.CreateDefault(*context_, options);
846  pipelines_->tiled_texture_uv_external.CreateDefault(*context_, options);
847 #endif // !defined(FML_OS_MACOSX)
848  pipelines_->texture_downsample_gles.CreateDefault(*context_,
849  options_trianglestrip);
850  }
851 #endif // IMPELLER_ENABLE_OPENGLES
852 
853  is_valid_ = true;
854  InitializeCommonlyUsedShadersIfNeeded();
855 }
856 
858 
860  return is_valid_;
861 }
862 
863 std::shared_ptr<Texture> ContentContext::GetEmptyTexture() const {
864  return empty_texture_;
865 }
866 
867 fml::StatusOr<RenderTarget> ContentContext::MakeSubpass(
868  std::string_view label,
869  ISize texture_size,
870  const std::shared_ptr<CommandBuffer>& command_buffer,
871  const SubpassCallback& subpass_callback,
872  bool msaa_enabled,
873  bool depth_stencil_enabled,
874  int32_t mip_count) const {
875  const std::shared_ptr<Context>& context = GetContext();
876  RenderTarget subpass_target;
877 
878  std::optional<RenderTarget::AttachmentConfig> depth_stencil_config =
879  depth_stencil_enabled ? RenderTarget::kDefaultStencilAttachmentConfig
880  : std::optional<RenderTarget::AttachmentConfig>();
881 
882  if (context->GetCapabilities()->SupportsOffscreenMSAA() && msaa_enabled) {
883  subpass_target = GetRenderTargetCache()->CreateOffscreenMSAA(
884  *context, texture_size,
885  /*mip_count=*/mip_count, label,
887  } else {
888  subpass_target = GetRenderTargetCache()->CreateOffscreen(
889  *context, texture_size,
890  /*mip_count=*/mip_count, label,
891  RenderTarget::kDefaultColorAttachmentConfig, depth_stencil_config);
892  }
893  return MakeSubpass(label, subpass_target, command_buffer, subpass_callback);
894 }
895 
896 fml::StatusOr<RenderTarget> ContentContext::MakeSubpass(
897  std::string_view label,
898  const RenderTarget& subpass_target,
899  const std::shared_ptr<CommandBuffer>& command_buffer,
900  const SubpassCallback& subpass_callback) const {
901  const std::shared_ptr<Context>& context = GetContext();
902 
903  auto subpass_texture = subpass_target.GetRenderTargetTexture();
904  if (!subpass_texture) {
905  return fml::Status(fml::StatusCode::kUnknown, "");
906  }
907 
908  auto sub_renderpass = command_buffer->CreateRenderPass(subpass_target);
909  if (!sub_renderpass) {
910  return fml::Status(fml::StatusCode::kUnknown, "");
911  }
912  sub_renderpass->SetLabel(label);
913 
914  if (!subpass_callback(*this, *sub_renderpass)) {
915  return fml::Status(fml::StatusCode::kUnknown, "");
916  }
917 
918  if (!sub_renderpass->EncodeCommands()) {
919  return fml::Status(fml::StatusCode::kUnknown, "");
920  }
921 
922  const std::shared_ptr<Texture>& target_texture =
923  subpass_target.GetRenderTargetTexture();
924  if (target_texture->GetMipCount() > 1) {
925  fml::Status mipmap_status =
926  AddMipmapGeneration(command_buffer, context, target_texture);
927  if (!mipmap_status.ok()) {
928  return mipmap_status;
929  }
930  }
931 
932  return subpass_target;
933 }
934 
936  return *tessellator_;
937 }
938 
939 std::shared_ptr<Context> ContentContext::GetContext() const {
940  return context_;
941 }
942 
944  return *context_->GetCapabilities();
945 }
946 
948  const std::string& unique_entrypoint_name,
949  const ContentContextOptions& options,
950  const std::function<std::shared_ptr<Pipeline<PipelineDescriptor>>()>&
951  create_callback) const {
952  RuntimeEffectPipelineKey key{unique_entrypoint_name, options};
953  auto it = runtime_effect_pipelines_.find(key);
954  if (it == runtime_effect_pipelines_.end()) {
955  it = runtime_effect_pipelines_.insert(it, {key, create_callback()});
956  }
957  return raw_ptr(it->second);
958 }
959 
961  const std::string& unique_entrypoint_name) const {
962 #ifdef IMPELLER_DEBUG
963  // destroying in-use pipleines is a validation error.
964  const auto& idle_waiter = GetContext()->GetIdleWaiter();
965  if (idle_waiter) {
966  idle_waiter->WaitIdle();
967  }
968 #endif // IMPELLER_DEBUG
969  for (auto it = runtime_effect_pipelines_.begin();
970  it != runtime_effect_pipelines_.end();) {
971  if (it->first.unique_entrypoint_name == unique_entrypoint_name) {
972  it = runtime_effect_pipelines_.erase(it);
973  } else {
974  it++;
975  }
976  }
977 }
978 
979 void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const {
980  if (GetContext()->GetFlags().lazy_shader_mode) {
981  return;
982  }
983  GetContext()->InitializeCommonlyUsedShadersIfNeeded();
984 }
985 
987  ContentContextOptions opts) const {
988  return GetPipeline(this, pipelines_->fast_gradient, opts);
989 }
990 
992  ContentContextOptions opts) const {
993  return GetPipeline(this, pipelines_->linear_gradient_fill, opts);
994 }
995 
997  ContentContextOptions opts) const {
998  return GetPipeline(this, pipelines_->linear_gradient_uniform_fill, opts);
999 }
1000 
1002  ContentContextOptions opts) const {
1003  return GetPipeline(this, pipelines_->radial_gradient_uniform_fill, opts);
1004 }
1005 
1007  ContentContextOptions opts) const {
1008  return GetPipeline(this, pipelines_->sweep_gradient_uniform_fill, opts);
1009 }
1010 
1012  ContentContextOptions opts) const {
1013  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1014  return GetPipeline(this, pipelines_->linear_gradient_ssbo_fill, opts);
1015 }
1016 
1018  ContentContextOptions opts) const {
1019  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1020  return GetPipeline(this, pipelines_->radial_gradient_ssbo_fill, opts);
1021 }
1022 
1024  ContentContextOptions opts,
1025  ConicalKind kind) const {
1026  switch (kind) {
1027  case ConicalKind::kConical:
1028  return GetPipeline(this, pipelines_->conical_gradient_uniform_fill, opts);
1029  case ConicalKind::kRadial:
1030  return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_radial,
1031  opts);
1032  case ConicalKind::kStrip:
1033  return GetPipeline(this, pipelines_->conical_gradient_uniform_fill_strip,
1034  opts);
1036  return GetPipeline(
1037  this, pipelines_->conical_gradient_uniform_fill_strip_and_radial,
1038  opts);
1039  }
1040 }
1041 
1043  ContentContextOptions opts,
1044  ConicalKind kind) const {
1045  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1046  switch (kind) {
1047  case ConicalKind::kConical:
1048  return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill, opts);
1049  case ConicalKind::kRadial:
1050  return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_radial,
1051  opts);
1052  case ConicalKind::kStrip:
1053  return GetPipeline(this, pipelines_->conical_gradient_ssbo_fill_strip,
1054  opts);
1056  return GetPipeline(
1057  this, pipelines_->conical_gradient_ssbo_fill_strip_and_radial, opts);
1058  }
1059 }
1060 
1062  ContentContextOptions opts) const {
1063  FML_DCHECK(GetDeviceCapabilities().SupportsSSBO());
1064  return GetPipeline(this, pipelines_->sweep_gradient_ssbo_fill, opts);
1065 }
1066 
1068  ContentContextOptions opts) const {
1069  return GetPipeline(this, pipelines_->radial_gradient_fill, opts);
1070 }
1071 
1073  ContentContextOptions opts,
1074  ConicalKind kind) const {
1075  switch (kind) {
1076  case ConicalKind::kConical:
1077  return GetPipeline(this, pipelines_->conical_gradient_fill, opts);
1078  case ConicalKind::kRadial:
1079  return GetPipeline(this, pipelines_->conical_gradient_fill_radial, opts);
1080  case ConicalKind::kStrip:
1081  return GetPipeline(this, pipelines_->conical_gradient_fill_strip, opts);
1083  return GetPipeline(
1084  this, pipelines_->conical_gradient_fill_strip_and_radial, opts);
1085  }
1086 }
1087 
1089  ContentContextOptions opts) const {
1090  return GetPipeline(this, pipelines_->rrect_blur, opts);
1091 }
1092 
1094  ContentContextOptions opts) const {
1095  return GetPipeline(this, pipelines_->rsuperellipse_blur, opts);
1096 }
1097 
1099  ContentContextOptions opts) const {
1100  return GetPipeline(this, pipelines_->sweep_gradient_fill, opts);
1101 }
1102 
1104  ContentContextOptions opts) const {
1105  return GetPipeline(this, pipelines_->solid_fill, opts);
1106 }
1107 
1109  ContentContextOptions opts) const {
1110  return GetPipeline(this, pipelines_->texture, opts);
1111 }
1112 
1114  ContentContextOptions opts) const {
1115  return GetPipeline(this, pipelines_->texture_strict_src, opts);
1116 }
1117 
1119  ContentContextOptions opts) const {
1120  return GetPipeline(this, pipelines_->tiled_texture, opts);
1121 }
1122 
1124  ContentContextOptions opts) const {
1125  return GetPipeline(this, pipelines_->gaussian_blur, opts);
1126 }
1127 
1129  ContentContextOptions opts) const {
1130  return GetPipeline(this, pipelines_->border_mask_blur, opts);
1131 }
1132 
1134  ContentContextOptions opts) const {
1135  return GetPipeline(this, pipelines_->morphology_filter, opts);
1136 }
1137 
1139  ContentContextOptions opts) const {
1140  return GetPipeline(this, pipelines_->color_matrix_color_filter, opts);
1141 }
1142 
1144  ContentContextOptions opts) const {
1145  return GetPipeline(this, pipelines_->linear_to_srgb_filter, opts);
1146 }
1147 
1149  ContentContextOptions opts) const {
1150  return GetPipeline(this, pipelines_->srgb_to_linear_filter, opts);
1151 }
1152 
1154  return GetPipeline(this, pipelines_->clip, opts);
1155 }
1156 
1158  ContentContextOptions opts) const {
1159  return GetPipeline(this, pipelines_->glyph_atlas, opts);
1160 }
1161 
1163  ContentContextOptions opts) const {
1164  return GetPipeline(this, pipelines_->yuv_to_rgb_filter, opts);
1165 }
1166 
1168  BlendMode mode,
1169  ContentContextOptions opts) const {
1170  switch (mode) {
1171  case BlendMode::kClear:
1172  return GetClearBlendPipeline(opts);
1173  case BlendMode::kSrc:
1174  return GetSourceBlendPipeline(opts);
1175  case BlendMode::kDst:
1176  return GetDestinationBlendPipeline(opts);
1177  case BlendMode::kSrcOver:
1178  return GetSourceOverBlendPipeline(opts);
1179  case BlendMode::kDstOver:
1180  return GetDestinationOverBlendPipeline(opts);
1181  case BlendMode::kSrcIn:
1182  return GetSourceInBlendPipeline(opts);
1183  case BlendMode::kDstIn:
1184  return GetDestinationInBlendPipeline(opts);
1185  case BlendMode::kSrcOut:
1186  return GetSourceOutBlendPipeline(opts);
1187  case BlendMode::kDstOut:
1188  return GetDestinationOutBlendPipeline(opts);
1189  case BlendMode::kSrcATop:
1190  return GetSourceATopBlendPipeline(opts);
1191  case BlendMode::kDstATop:
1192  return GetDestinationATopBlendPipeline(opts);
1193  case BlendMode::kXor:
1194  return GetXorBlendPipeline(opts);
1195  case BlendMode::kPlus:
1196  return GetPlusBlendPipeline(opts);
1197  case BlendMode::kModulate:
1198  return GetModulateBlendPipeline(opts);
1199  case BlendMode::kScreen:
1200  return GetScreenBlendPipeline(opts);
1201  case BlendMode::kOverlay:
1202  case BlendMode::kDarken:
1203  case BlendMode::kLighten:
1205  case BlendMode::kColorBurn:
1206  case BlendMode::kHardLight:
1207  case BlendMode::kSoftLight:
1209  case BlendMode::kExclusion:
1210  case BlendMode::kMultiply:
1211  case BlendMode::kHue:
1213  case BlendMode::kColor:
1215  VALIDATION_LOG << "Invalid porter duff blend mode "
1216  << BlendModeToString(mode);
1217  return GetClearBlendPipeline(opts);
1218  break;
1219  }
1220 }
1221 
1223  ContentContextOptions opts) const {
1224  return GetPipeline(this, pipelines_->clear_blend, opts);
1225 }
1226 
1228  ContentContextOptions opts) const {
1229  return GetPipeline(this, pipelines_->source_blend, opts);
1230 }
1231 
1233  ContentContextOptions opts) const {
1234  return GetPipeline(this, pipelines_->destination_blend, opts);
1235 }
1236 
1238  ContentContextOptions opts) const {
1239  return GetPipeline(this, pipelines_->source_over_blend, opts);
1240 }
1241 
1243  ContentContextOptions opts) const {
1244  return GetPipeline(this, pipelines_->destination_over_blend, opts);
1245 }
1246 
1248  ContentContextOptions opts) const {
1249  return GetPipeline(this, pipelines_->source_in_blend, opts);
1250 }
1251 
1253  ContentContextOptions opts) const {
1254  return GetPipeline(this, pipelines_->destination_in_blend, opts);
1255 }
1256 
1258  ContentContextOptions opts) const {
1259  return GetPipeline(this, pipelines_->source_out_blend, opts);
1260 }
1261 
1263  ContentContextOptions opts) const {
1264  return GetPipeline(this, pipelines_->destination_out_blend, opts);
1265 }
1266 
1268  ContentContextOptions opts) const {
1269  return GetPipeline(this, pipelines_->source_a_top_blend, opts);
1270 }
1271 
1273  ContentContextOptions opts) const {
1274  return GetPipeline(this, pipelines_->destination_a_top_blend, opts);
1275 }
1276 
1278  ContentContextOptions opts) const {
1279  return GetPipeline(this, pipelines_->xor_blend, opts);
1280 }
1281 
1283  ContentContextOptions opts) const {
1284  return GetPipeline(this, pipelines_->plus_blend, opts);
1285 }
1286 
1288  ContentContextOptions opts) const {
1289  return GetPipeline(this, pipelines_->modulate_blend, opts);
1290 }
1291 
1293  ContentContextOptions opts) const {
1294  return GetPipeline(this, pipelines_->screen_blend, opts);
1295 }
1296 
1298  ContentContextOptions opts) const {
1299  return GetPipeline(this, pipelines_->blend_color, opts);
1300 }
1301 
1303  ContentContextOptions opts) const {
1304  return GetPipeline(this, pipelines_->blend_colorburn, opts);
1305 }
1306 
1308  ContentContextOptions opts) const {
1309  return GetPipeline(this, pipelines_->blend_colordodge, opts);
1310 }
1311 
1313  ContentContextOptions opts) const {
1314  return GetPipeline(this, pipelines_->blend_darken, opts);
1315 }
1316 
1318  ContentContextOptions opts) const {
1319  return GetPipeline(this, pipelines_->blend_difference, opts);
1320 }
1321 
1323  ContentContextOptions opts) const {
1324  return GetPipeline(this, pipelines_->blend_exclusion, opts);
1325 }
1326 
1328  ContentContextOptions opts) const {
1329  return GetPipeline(this, pipelines_->blend_hardlight, opts);
1330 }
1331 
1333  ContentContextOptions opts) const {
1334  return GetPipeline(this, pipelines_->blend_hue, opts);
1335 }
1336 
1338  ContentContextOptions opts) const {
1339  return GetPipeline(this, pipelines_->blend_lighten, opts);
1340 }
1341 
1343  ContentContextOptions opts) const {
1344  return GetPipeline(this, pipelines_->blend_luminosity, opts);
1345 }
1346 
1348  ContentContextOptions opts) const {
1349  return GetPipeline(this, pipelines_->blend_multiply, opts);
1350 }
1351 
1353  ContentContextOptions opts) const {
1354  return GetPipeline(this, pipelines_->blend_overlay, opts);
1355 }
1356 
1358  ContentContextOptions opts) const {
1359  return GetPipeline(this, pipelines_->blend_saturation, opts);
1360 }
1361 
1363  ContentContextOptions opts) const {
1364  return GetPipeline(this, pipelines_->blend_screen, opts);
1365 }
1366 
1368  ContentContextOptions opts) const {
1369  return GetPipeline(this, pipelines_->blend_softlight, opts);
1370 }
1371 
1373  ContentContextOptions opts) const {
1374  return GetPipeline(this, pipelines_->texture_downsample, opts);
1375 }
1376 
1378  ContentContextOptions opts) const {
1379  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1380  return GetPipeline(this, pipelines_->framebuffer_blend_color, opts);
1381 }
1382 
1384  ContentContextOptions opts) const {
1385  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1386  return GetPipeline(this, pipelines_->framebuffer_blend_colorburn, opts);
1387 }
1388 
1390  ContentContextOptions opts) const {
1391  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1392  return GetPipeline(this, pipelines_->framebuffer_blend_colordodge, opts);
1393 }
1394 
1396  ContentContextOptions opts) const {
1397  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1398  return GetPipeline(this, pipelines_->framebuffer_blend_darken, opts);
1399 }
1400 
1402  ContentContextOptions opts) const {
1403  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1404  return GetPipeline(this, pipelines_->framebuffer_blend_difference, opts);
1405 }
1406 
1408  ContentContextOptions opts) const {
1409  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1410  return GetPipeline(this, pipelines_->framebuffer_blend_exclusion, opts);
1411 }
1412 
1414  ContentContextOptions opts) const {
1415  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1416  return GetPipeline(this, pipelines_->framebuffer_blend_hardlight, opts);
1417 }
1418 
1420  ContentContextOptions opts) const {
1421  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1422  return GetPipeline(this, pipelines_->framebuffer_blend_hue, opts);
1423 }
1424 
1426  ContentContextOptions opts) const {
1427  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1428  return GetPipeline(this, pipelines_->framebuffer_blend_lighten, opts);
1429 }
1430 
1432  ContentContextOptions opts) const {
1433  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1434  return GetPipeline(this, pipelines_->framebuffer_blend_luminosity, opts);
1435 }
1436 
1438  ContentContextOptions opts) const {
1439  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1440  return GetPipeline(this, pipelines_->framebuffer_blend_multiply, opts);
1441 }
1442 
1444  ContentContextOptions opts) const {
1445  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1446  return GetPipeline(this, pipelines_->framebuffer_blend_overlay, opts);
1447 }
1448 
1450  ContentContextOptions opts) const {
1451  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1452  return GetPipeline(this, pipelines_->framebuffer_blend_saturation, opts);
1453 }
1454 
1456  ContentContextOptions opts) const {
1457  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1458  return GetPipeline(this, pipelines_->framebuffer_blend_screen, opts);
1459 }
1460 
1462  ContentContextOptions opts) const {
1463  FML_DCHECK(GetDeviceCapabilities().SupportsFramebufferFetch());
1464  return GetPipeline(this, pipelines_->framebuffer_blend_softlight, opts);
1465 }
1466 
1468  BlendMode blend_mode,
1469  ContentContextOptions opts) const {
1470  if (blend_mode <= BlendMode::kHardLight) {
1471  return GetPipeline(this, pipelines_->vertices_uber_1_, opts);
1472  } else {
1473  return GetPipeline(this, pipelines_->vertices_uber_2_, opts);
1474  }
1475 }
1476 
1478  return GetPipeline(this, pipelines_->line, opts);
1479 }
1480 
1481 #ifdef IMPELLER_ENABLE_OPENGLES
1482 PipelineRef ContentContext::GetDownsampleTextureGlesPipeline(
1483  ContentContextOptions opts) const {
1484  return GetPipeline(this, pipelines_->texture_downsample_gles, opts);
1485 }
1486 
1487 PipelineRef ContentContext::GetTiledTextureExternalPipeline(
1488  ContentContextOptions opts) const {
1489  FML_DCHECK(GetContext()->GetBackendType() == Context::BackendType::kOpenGLES);
1490  return GetPipeline(this, pipelines_->tiled_texture_external, opts);
1491 }
1492 
1493 PipelineRef ContentContext::GetTiledTextureUvExternalPipeline(
1494  ContentContextOptions opts) const {
1495  FML_DCHECK(GetContext()->GetBackendType() == Context::BackendType::kOpenGLES);
1496  return GetPipeline(this, pipelines_->tiled_texture_uv_external, opts);
1497 }
1498 #endif // IMPELLER_ENABLE_OPENGLES
1499 
1500 } // namespace impeller
BufferView buffer_view
PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorPipeline(ContentContextOptions opts) const
PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const
PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const
void ClearCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name) const
PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
std::shared_ptr< Texture > GetEmptyTexture() const
PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const
PipelineRef GetLinePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const
PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const
ContentContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::shared_ptr< RenderTargetAllocator > render_target_allocator=nullptr)
PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const
fml::StatusOr< RenderTarget > MakeSubpass(std::string_view label, ISize texture_size, const std::shared_ptr< CommandBuffer > &command_buffer, const SubpassCallback &subpass_callback, bool msaa_enabled=true, bool depth_stencil_enabled=false, int32_t mip_count=1) const
Creates a new texture of size texture_size and calls subpass_callback with a RenderPass for drawing t...
const Capabilities & GetDeviceCapabilities() const
PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const
PipelineRef GetCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name, const ContentContextOptions &options, const std::function< std::shared_ptr< Pipeline< PipelineDescriptor >>()> &create_callback) const
PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const
PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const
PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const
PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts, ConicalKind kind) const
PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const
PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const
PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const
PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const
PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const
PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const
PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const
PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const
PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const
PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const
PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const
PipelineRef GetClipPipeline(ContentContextOptions opts) const
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const
PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const
PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const
PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const
PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const
PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Tessellator & GetTessellator() const
PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const
PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const
PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const
PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts, ConicalKind kind) const
std::shared_ptr< Context > GetContext() const
PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const
PipelineRef GetRSuperellipseBlurPipeline(ContentContextOptions opts) const
PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const
PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const
To do anything rendering related with Impeller, you need a context.
Definition: context.h:65
virtual const std::shared_ptr< const Capabilities > & GetCapabilities() const =0
Get the capabilities of Impeller context. All optionally supported feature of the platform,...
static constexpr BlendMode kLastPipelineBlendMode
Definition: entity.h:28
BufferView Emplace(const BufferType &buffer, size_t alignment=0)
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
Definition: host_buffer.h:92
PipelineDescriptor & SetDepthStencilAttachmentDescriptor(std::optional< DepthAttachmentDescriptor > desc)
void SetPolygonMode(PolygonMode mode)
std::optional< DepthAttachmentDescriptor > GetDepthStencilAttachmentDescriptor() const
PipelineDescriptor & SetStencilAttachmentDescriptors(std::optional< StencilAttachmentDescriptor > front_and_back)
const ColorAttachmentDescriptor * GetColorAttachmentDescriptor(size_t index) const
PipelineDescriptor & SetColorAttachmentDescriptor(size_t index, ColorAttachmentDescriptor desc)
PipelineDescriptor & SetSampleCount(SampleCount samples)
void SetPrimitiveType(PrimitiveType type)
std::optional< StencilAttachmentDescriptor > GetFrontStencilAttachmentDescriptor() const
An implementation of the [RenderTargetAllocator] that caches all allocated texture data for one frame...
std::shared_ptr< Texture > GetRenderTargetTexture() const
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
Definition: render_target.h:55
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
Definition: render_target.h:61
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig
Definition: render_target.h:68
A utility that generates triangles of the specified fill type given a polyline. This happens on the C...
Definition: tessellator.h:37
A cache for blurred text that re-uses these across frames.
std::optional< PipelineDescriptor > desc_
std::vector< std::pair< uint64_t, std::unique_ptr< GenericRenderPipelineHandle > > > pipelines_
std::optional< ContentContextOptions > default_options_
int32_t x
ScopedObject< Object > Create(CtorArgs &&... args)
Definition: object.h:161
float Scalar
Definition: scalar.h:19
static std::unique_ptr< PipelineT > CreateDefaultPipeline(const Context &context)
raw_ptr< Pipeline< PipelineDescriptor > > PipelineRef
A raw ptr to a pipeline object.
Definition: pipeline.h:88
const char * BlendModeToString(BlendMode blend_mode)
Definition: color.cc:47
@ kEqual
Comparison test passes if new_value == current_value.
@ kAlways
Comparison test passes always passes.
@ kLess
Comparison test passes if new_value < current_value.
@ kNotEqual
Comparison test passes if new_value != current_value.
fml::Status AddMipmapGeneration(const std::shared_ptr< CommandBuffer > &command_buffer, const std::shared_ptr< Context > &context, const std::shared_ptr< Texture > &texture)
Adds a blit command to the render pass.
Definition: texture_util.cc:37
@ kDecrementWrap
Decrement the current stencil value by 1. If at zero, set to maximum.
@ kSetToReferenceValue
Reset the stencil value to the reference value.
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
@ kIncrementWrap
Increment the current stencil value by 1. If at maximum, set to zero.
@ kKeep
Don't modify the current stencil value.
BlendMode
Definition: color.h:58
std::array< std::vector< Scalar >, 15 > GetPorterDuffSpecConstants(bool supports_decal)
Definition: comparable.h:95
Describe the color attachment that will be used with this pipeline.
Definition: formats.h:518
std::array< uint8_t, 4 > ToR8G8B8A8() const
Convert to R8G8B8A8 representation.
Definition: color.h:246
static constexpr Color BlackTransparent()
Definition: color.h:270
Variants< SolidFillPipeline > solid_fill
Variants< PorterDuffBlendPipeline > destination_blend
Variants< SweepGradientSSBOFillPipeline > sweep_gradient_ssbo_fill
Variants< BlendScreenPipeline > blend_screen
Variants< PorterDuffBlendPipeline > modulate_blend
Variants< FramebufferBlendOverlayPipeline > framebuffer_blend_overlay
Variants< BlendSaturationPipeline > blend_saturation
Variants< TiledTexturePipeline > tiled_texture
Variants< PorterDuffBlendPipeline > destination_in_blend
Variants< BlendSoftLightPipeline > blend_softlight
Variants< BlendColorDodgePipeline > blend_colordodge
Variants< BlendMultiplyPipeline > blend_multiply
Variants< BlendColorPipeline > blend_color
Variants< BlendDifferencePipeline > blend_difference
Variants< BlendOverlayPipeline > blend_overlay
Variants< ConicalGradientFillStripPipeline > conical_gradient_fill_strip
Variants< FramebufferBlendExclusionPipeline > framebuffer_blend_exclusion
Variants< MorphologyFilterPipeline > morphology_filter
Variants< PorterDuffBlendPipeline > screen_blend
Variants< FramebufferBlendSaturationPipeline > framebuffer_blend_saturation
Variants< PorterDuffBlendPipeline > source_over_blend
Variants< LinearGradientFillPipeline > linear_gradient_fill
Variants< PorterDuffBlendPipeline > plus_blend
Variants< VerticesUber2Shader > vertices_uber_2_
Variants< FramebufferBlendHardLightPipeline > framebuffer_blend_hardlight
Variants< RadialGradientSSBOFillPipeline > radial_gradient_ssbo_fill
Variants< PorterDuffBlendPipeline > clear_blend
Variants< ConicalGradientUniformFillConicalPipeline > conical_gradient_uniform_fill
Variants< FramebufferBlendMultiplyPipeline > framebuffer_blend_multiply
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill
Variants< TextureDownsamplePipeline > texture_downsample
Variants< FramebufferBlendLuminosityPipeline > framebuffer_blend_luminosity
Variants< FramebufferBlendSoftLightPipeline > framebuffer_blend_softlight
Variants< SweepGradientUniformFillPipeline > sweep_gradient_uniform_fill
Variants< BlendColorBurnPipeline > blend_colorburn
Variants< ConicalGradientUniformFillStripRadialPipeline > conical_gradient_uniform_fill_strip_and_radial
Variants< PorterDuffBlendPipeline > source_in_blend
Variants< ConicalGradientFillConicalPipeline > conical_gradient_fill
Variants< SweepGradientFillPipeline > sweep_gradient_fill
Variants< FramebufferBlendLightenPipeline > framebuffer_blend_lighten
Variants< PorterDuffBlendPipeline > source_a_top_blend
Variants< PorterDuffBlendPipeline > destination_a_top_blend
Variants< RadialGradientUniformFillPipeline > radial_gradient_uniform_fill
Variants< BlendLightenPipeline > blend_lighten
Variants< LinearGradientUniformFillPipeline > linear_gradient_uniform_fill
Variants< FramebufferBlendColorBurnPipeline > framebuffer_blend_colorburn
Variants< ConicalGradientFillRadialPipeline > conical_gradient_fill_radial
Variants< PorterDuffBlendPipeline > destination_over_blend
Variants< BlendExclusionPipeline > blend_exclusion
Variants< RSuperellipseBlurPipeline > rsuperellipse_blur
Variants< SrgbToLinearFilterPipeline > srgb_to_linear_filter
Variants< ColorMatrixColorFilterPipeline > color_matrix_color_filter
Variants< LinearToSrgbFilterPipeline > linear_to_srgb_filter
Variants< ConicalGradientUniformFillRadialPipeline > conical_gradient_uniform_fill_radial
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_strip
Variants< RRectBlurPipeline > rrect_blur
Variants< BlendDarkenPipeline > blend_darken
Variants< TexturePipeline > texture
Variants< PorterDuffBlendPipeline > source_out_blend
Variants< FramebufferBlendHuePipeline > framebuffer_blend_hue
Variants< TextureStrictSrcPipeline > texture_strict_src
Variants< FramebufferBlendColorPipeline > framebuffer_blend_color
Variants< BlendHuePipeline > blend_hue
Variants< FramebufferBlendDarkenPipeline > framebuffer_blend_darken
Variants< FastGradientPipeline > fast_gradient
Variants< ConicalGradientUniformFillStripPipeline > conical_gradient_uniform_fill_strip
Variants< PorterDuffBlendPipeline > xor_blend
Variants< GaussianBlurPipeline > gaussian_blur
Variants< LinearGradientSSBOFillPipeline > linear_gradient_ssbo_fill
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_strip_and_radial
Variants< GlyphAtlasPipeline > glyph_atlas
Variants< PorterDuffBlendPipeline > source_blend
Variants< BlendLuminosityPipeline > blend_luminosity
Variants< BorderMaskBlurPipeline > border_mask_blur
Variants< FramebufferBlendScreenPipeline > framebuffer_blend_screen
Variants< FramebufferBlendDifferencePipeline > framebuffer_blend_difference
Variants< YUVToRGBFilterPipeline > yuv_to_rgb_filter
Variants< RadialGradientFillPipeline > radial_gradient_fill
Variants< ConicalGradientSSBOFillPipeline > conical_gradient_ssbo_fill_radial
Variants< ConicalGradientFillStripRadialPipeline > conical_gradient_fill_strip_and_radial
Variants< BlendHardLightPipeline > blend_hardlight
Variants< FramebufferBlendColorDodgePipeline > framebuffer_blend_colordodge
Variants< PorterDuffBlendPipeline > destination_out_blend
Variants< VerticesUber1Shader > vertices_uber_1_
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
static std::optional< PipelineDescriptor > MakeDefaultPipelineDescriptor(const Context &context, const std::vector< Scalar > &constants={})
Create a default pipeline descriptor using the combination reflected shader information....
StencilOperation depth_stencil_pass
Definition: formats.h:629
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:68
#define VALIDATION_LOG
Definition: validation.h:91