Flutter Impeller
render_pass_gles.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 <cstdint>
8 
9 #include "GLES3/gl3.h"
10 #include "flutter/fml/trace_event.h"
11 #include "fml/closure.h"
12 #include "fml/logging.h"
20 
21 namespace impeller {
22 
23 RenderPassGLES::RenderPassGLES(std::shared_ptr<const Context> context,
24  const RenderTarget& target,
25  ReactorGLES::Ref reactor)
26  : RenderPass(std::move(context), target),
27  reactor_(std::move(reactor)),
28  is_valid_(reactor_ && reactor_->IsValid()) {}
29 
30 // |RenderPass|
32 
33 // |RenderPass|
34 bool RenderPassGLES::IsValid() const {
35  return is_valid_;
36 }
37 
38 // |RenderPass|
39 void RenderPassGLES::OnSetLabel(std::string label) {
40  label_ = std::move(label);
41 }
42 
44  const ColorAttachmentDescriptor* color) {
45  if (color->blending_enabled) {
46  gl.Enable(GL_BLEND);
47  gl.BlendFuncSeparate(
48  ToBlendFactor(color->src_color_blend_factor), // src color
49  ToBlendFactor(color->dst_color_blend_factor), // dst color
50  ToBlendFactor(color->src_alpha_blend_factor), // src alpha
51  ToBlendFactor(color->dst_alpha_blend_factor) // dst alpha
52  );
53  gl.BlendEquationSeparate(
54  ToBlendOperation(color->color_blend_op), // mode color
55  ToBlendOperation(color->alpha_blend_op) // mode alpha
56  );
57  } else {
58  gl.Disable(GL_BLEND);
59  }
60 
61  {
62  const auto is_set = [](ColorWriteMask mask,
63  ColorWriteMask check) -> GLboolean {
64  return (mask & check) ? GL_TRUE : GL_FALSE;
65  };
66 
67  gl.ColorMask(
68  is_set(color->write_mask, ColorWriteMaskBits::kRed), // red
69  is_set(color->write_mask, ColorWriteMaskBits::kGreen), // green
70  is_set(color->write_mask, ColorWriteMaskBits::kBlue), // blue
71  is_set(color->write_mask, ColorWriteMaskBits::kAlpha) // alpha
72  );
73  }
74 }
75 
76 void ConfigureStencil(GLenum face,
77  const ProcTableGLES& gl,
78  const StencilAttachmentDescriptor& stencil,
79  uint32_t stencil_reference) {
80  gl.StencilOpSeparate(
81  face, // face
82  ToStencilOp(stencil.stencil_failure), // stencil fail
83  ToStencilOp(stencil.depth_failure), // depth fail
84  ToStencilOp(stencil.depth_stencil_pass) // depth stencil pass
85  );
86  gl.StencilFuncSeparate(face, // face
87  ToCompareFunction(stencil.stencil_compare), // func
88  stencil_reference, // ref
89  stencil.read_mask // mask
90  );
91  gl.StencilMaskSeparate(face, stencil.write_mask);
92 }
93 
95  const PipelineDescriptor& pipeline,
96  uint32_t stencil_reference) {
97  if (!pipeline.HasStencilAttachmentDescriptors()) {
98  gl.Disable(GL_STENCIL_TEST);
99  return;
100  }
101 
102  gl.Enable(GL_STENCIL_TEST);
103  const auto& front = pipeline.GetFrontStencilAttachmentDescriptor();
104  const auto& back = pipeline.GetBackStencilAttachmentDescriptor();
105 
106  if (front.has_value() && back.has_value() && front == back) {
107  ConfigureStencil(GL_FRONT_AND_BACK, gl, *front, stencil_reference);
108  return;
109  }
110  if (front.has_value()) {
111  ConfigureStencil(GL_FRONT, gl, *front, stencil_reference);
112  }
113  if (back.has_value()) {
114  ConfigureStencil(GL_BACK, gl, *back, stencil_reference);
115  }
116 }
117 
118 //------------------------------------------------------------------------------
119 /// @brief Encapsulates data that will be needed in the reactor for the
120 /// encoding of commands for this render pass.
121 ///
124 
126  uint32_t clear_stencil = 0u;
128 
129  std::shared_ptr<Texture> color_attachment;
130  std::shared_ptr<Texture> depth_attachment;
131  std::shared_ptr<Texture> stencil_attachment;
132 
136 
140 
141  std::string label;
142 };
143 
144 [[nodiscard]] bool EncodeCommandsInReactor(
145  const RenderPassData& pass_data,
146  const std::shared_ptr<Allocator>& transients_allocator,
147  const ReactorGLES& reactor,
148  const std::vector<Command>& commands,
149  const std::shared_ptr<GPUTracerGLES>& tracer) {
150  TRACE_EVENT0("impeller", "RenderPassGLES::EncodeCommandsInReactor");
151 
152  const auto& gl = reactor.GetProcTable();
153 #ifdef IMPELLER_DEBUG
154  tracer->MarkFrameStart(gl);
155 #endif // IMPELLER_DEBUG
156 
157  fml::ScopedCleanupClosure pop_pass_debug_marker(
158  [&gl]() { gl.PopDebugGroup(); });
159  if (!pass_data.label.empty()) {
160  gl.PushDebugGroup(pass_data.label);
161  } else {
162  pop_pass_debug_marker.Release();
163  }
164 
165  GLuint fbo = GL_NONE;
166  fml::ScopedCleanupClosure delete_fbo([&gl, &fbo]() {
167  if (fbo != GL_NONE) {
168  gl.BindFramebuffer(GL_FRAMEBUFFER, GL_NONE);
169  gl.DeleteFramebuffers(1u, &fbo);
170  }
171  });
172 
173  const auto is_default_fbo =
175 
176  if (!is_default_fbo) {
177  // Create and bind an offscreen FBO.
178  gl.GenFramebuffers(1u, &fbo);
179  gl.BindFramebuffer(GL_FRAMEBUFFER, fbo);
180 
181  if (auto color = TextureGLES::Cast(pass_data.color_attachment.get())) {
182  if (!color->SetAsFramebufferAttachment(
183  GL_FRAMEBUFFER, TextureGLES::AttachmentType::kColor0)) {
184  return false;
185  }
186  }
187 
188  if (auto depth = TextureGLES::Cast(pass_data.depth_attachment.get())) {
189  if (!depth->SetAsFramebufferAttachment(
190  GL_FRAMEBUFFER, TextureGLES::AttachmentType::kDepth)) {
191  return false;
192  }
193  }
194  if (auto stencil = TextureGLES::Cast(pass_data.stencil_attachment.get())) {
195  if (!stencil->SetAsFramebufferAttachment(
196  GL_FRAMEBUFFER, TextureGLES::AttachmentType::kStencil)) {
197  return false;
198  }
199  }
200 
201  auto status = gl.CheckFramebufferStatus(GL_FRAMEBUFFER);
202  if (status != GL_FRAMEBUFFER_COMPLETE) {
203  VALIDATION_LOG << "Could not create a complete frambuffer: "
204  << DebugToFramebufferError(status);
205  return false;
206  }
207  }
208 
209  gl.ClearColor(pass_data.clear_color.red, // red
210  pass_data.clear_color.green, // green
211  pass_data.clear_color.blue, // blue
212  pass_data.clear_color.alpha // alpha
213  );
214  if (pass_data.depth_attachment) {
215  if (gl.DepthRangef.IsAvailable()) {
216  gl.ClearDepthf(pass_data.clear_depth);
217  } else {
218  gl.ClearDepth(pass_data.clear_depth);
219  }
220  }
221  if (pass_data.stencil_attachment) {
222  gl.ClearStencil(pass_data.clear_stencil);
223  }
224 
225  GLenum clear_bits = 0u;
226  if (pass_data.clear_color_attachment) {
227  clear_bits |= GL_COLOR_BUFFER_BIT;
228  }
229  if (pass_data.clear_depth_attachment) {
230  clear_bits |= GL_DEPTH_BUFFER_BIT;
231  }
232  if (pass_data.clear_stencil_attachment) {
233  clear_bits |= GL_STENCIL_BUFFER_BIT;
234  }
235 
236  gl.Disable(GL_SCISSOR_TEST);
237  gl.Disable(GL_DEPTH_TEST);
238  gl.Disable(GL_STENCIL_TEST);
239  gl.Disable(GL_CULL_FACE);
240  gl.Disable(GL_BLEND);
241  gl.ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
242  gl.DepthMask(GL_TRUE);
243  gl.StencilMaskSeparate(GL_FRONT, 0xFFFFFFFF);
244  gl.StencilMaskSeparate(GL_BACK, 0xFFFFFFFF);
245 
246  gl.Clear(clear_bits);
247 
248  for (const auto& command : commands) {
249  if (command.instance_count != 1u) {
250  VALIDATION_LOG << "GLES backend does not support instanced rendering.";
251  return false;
252  }
253 
254  if (!command.pipeline) {
255  VALIDATION_LOG << "Command has no pipeline specified.";
256  return false;
257  }
258 
259 #ifdef IMPELLER_DEBUG
260  fml::ScopedCleanupClosure pop_cmd_debug_marker(
261  [&gl]() { gl.PopDebugGroup(); });
262  if (!command.label.empty()) {
263  gl.PushDebugGroup(command.label);
264  } else {
265  pop_cmd_debug_marker.Release();
266  }
267 #endif // IMPELLER_DEBUG
268 
269  const auto& pipeline = PipelineGLES::Cast(*command.pipeline);
270 
271  const auto* color_attachment =
272  pipeline.GetDescriptor().GetLegacyCompatibleColorAttachment();
273  if (!color_attachment) {
275  << "Color attachment is too complicated for a legacy renderer.";
276  return false;
277  }
278 
279  //--------------------------------------------------------------------------
280  /// Configure blending.
281  ///
282  ConfigureBlending(gl, color_attachment);
283 
284  //--------------------------------------------------------------------------
285  /// Setup stencil.
286  ///
287  ConfigureStencil(gl, pipeline.GetDescriptor(), command.stencil_reference);
288 
289  //--------------------------------------------------------------------------
290  /// Configure depth.
291  ///
292  if (auto depth =
293  pipeline.GetDescriptor().GetDepthStencilAttachmentDescriptor();
294  depth.has_value()) {
295  gl.Enable(GL_DEPTH_TEST);
296  gl.DepthFunc(ToCompareFunction(depth->depth_compare));
297  gl.DepthMask(depth->depth_write_enabled ? GL_TRUE : GL_FALSE);
298  } else {
299  gl.Disable(GL_DEPTH_TEST);
300  }
301 
302  // Both the viewport and scissor are specified in framebuffer coordinates.
303  // Impeller's framebuffer coordinate system is top left origin, but OpenGL's
304  // is bottom left origin, so we convert the coordinates here.
305  auto target_size = pass_data.color_attachment->GetSize();
306 
307  //--------------------------------------------------------------------------
308  /// Setup the viewport.
309  ///
310  const auto& viewport = command.viewport.value_or(pass_data.viewport);
311  gl.Viewport(viewport.rect.GetX(), // x
312  target_size.height - viewport.rect.GetY() -
313  viewport.rect.GetHeight(), // y
314  viewport.rect.GetWidth(), // width
315  viewport.rect.GetHeight() // height
316  );
317  if (pass_data.depth_attachment) {
318  if (gl.DepthRangef.IsAvailable()) {
319  gl.DepthRangef(viewport.depth_range.z_near, viewport.depth_range.z_far);
320  } else {
321  gl.DepthRange(viewport.depth_range.z_near, viewport.depth_range.z_far);
322  }
323  }
324 
325  //--------------------------------------------------------------------------
326  /// Setup the scissor rect.
327  ///
328  if (command.scissor.has_value()) {
329  const auto& scissor = command.scissor.value();
330  gl.Enable(GL_SCISSOR_TEST);
331  gl.Scissor(
332  scissor.GetX(), // x
333  target_size.height - scissor.GetY() - scissor.GetHeight(), // y
334  scissor.GetWidth(), // width
335  scissor.GetHeight() // height
336  );
337  } else {
338  gl.Disable(GL_SCISSOR_TEST);
339  }
340 
341  //--------------------------------------------------------------------------
342  /// Setup culling.
343  ///
344  switch (pipeline.GetDescriptor().GetCullMode()) {
345  case CullMode::kNone:
346  gl.Disable(GL_CULL_FACE);
347  break;
349  gl.Enable(GL_CULL_FACE);
350  gl.CullFace(GL_FRONT);
351  break;
352  case CullMode::kBackFace:
353  gl.Enable(GL_CULL_FACE);
354  gl.CullFace(GL_BACK);
355  break;
356  }
357  //--------------------------------------------------------------------------
358  /// Setup winding order.
359  ///
360  switch (pipeline.GetDescriptor().GetWindingOrder()) {
362  gl.FrontFace(GL_CW);
363  break;
365  gl.FrontFace(GL_CCW);
366  break;
367  }
368 
369  if (command.vertex_buffer.index_type == IndexType::kUnknown) {
370  return false;
371  }
372 
373  auto vertex_desc_gles = pipeline.GetBufferBindings();
374 
375  //--------------------------------------------------------------------------
376  /// Bind vertex and index buffers.
377  ///
378  auto& vertex_buffer_view = command.vertex_buffer.vertex_buffer;
379 
380  if (!vertex_buffer_view) {
381  return false;
382  }
383 
384  auto vertex_buffer = vertex_buffer_view.buffer;
385 
386  if (!vertex_buffer) {
387  return false;
388  }
389 
390  const auto& vertex_buffer_gles = DeviceBufferGLES::Cast(*vertex_buffer);
391  if (!vertex_buffer_gles.BindAndUploadDataIfNecessary(
393  return false;
394  }
395 
396  //--------------------------------------------------------------------------
397  /// Bind the pipeline program.
398  ///
399  if (!pipeline.BindProgram()) {
400  return false;
401  }
402 
403  //--------------------------------------------------------------------------
404  /// Bind vertex attribs.
405  ///
406  if (!vertex_desc_gles->BindVertexAttributes(
407  gl, vertex_buffer_view.range.offset)) {
408  return false;
409  }
410 
411  //--------------------------------------------------------------------------
412  /// Bind uniform data.
413  ///
414  if (!vertex_desc_gles->BindUniformData(gl, //
415  *transients_allocator, //
416  command.vertex_bindings, //
417  command.fragment_bindings //
418  )) {
419  return false;
420  }
421 
422  //--------------------------------------------------------------------------
423  /// Determine the primitive type.
424  ///
425  // GLES doesn't support setting the fill mode, so override the primitive
426  // with GL_LINE_STRIP to somewhat emulate PolygonMode::kLine. This isn't
427  // correct; full triangle outlines won't be drawn and disconnected
428  // geometry may appear connected. However this can still be useful for
429  // wireframe debug views.
430  auto mode = pipeline.GetDescriptor().GetPolygonMode() == PolygonMode::kLine
431  ? GL_LINE_STRIP
432  : ToMode(pipeline.GetDescriptor().GetPrimitiveType());
433 
434  //--------------------------------------------------------------------------
435  /// Finally! Invoke the draw call.
436  ///
437  if (command.vertex_buffer.index_type == IndexType::kNone) {
438  gl.DrawArrays(mode, command.base_vertex,
439  command.vertex_buffer.vertex_count);
440  } else {
441  // Bind the index buffer if necessary.
442  auto index_buffer_view = command.vertex_buffer.index_buffer;
443  auto index_buffer = index_buffer_view.buffer;
444  const auto& index_buffer_gles = DeviceBufferGLES::Cast(*index_buffer);
445  if (!index_buffer_gles.BindAndUploadDataIfNecessary(
447  return false;
448  }
449  gl.DrawElements(mode, // mode
450  command.vertex_buffer.vertex_count, // count
451  ToIndexType(command.vertex_buffer.index_type), // type
452  reinterpret_cast<const GLvoid*>(static_cast<GLsizei>(
453  index_buffer_view.range.offset)) // indices
454  );
455  }
456 
457  //--------------------------------------------------------------------------
458  /// Unbind vertex attribs.
459  ///
460  if (!vertex_desc_gles->UnbindVertexAttributes(gl)) {
461  return false;
462  }
463 
464  //--------------------------------------------------------------------------
465  /// Unbind the program pipeline.
466  ///
467  if (!pipeline.UnbindProgram()) {
468  return false;
469  }
470  }
471 
472  if (gl.DiscardFramebufferEXT.IsAvailable()) {
473  std::vector<GLenum> attachments;
474 
475  // TODO(jonahwilliams): discarding stencil or depth on the default fbo
476  // causes Angle to discard the entire render target. Until we know the
477  // reason, default to storing.
478  bool angle_safe = gl.GetCapabilities()->IsANGLE() ? !is_default_fbo : true;
479 
480  if (pass_data.discard_color_attachment) {
481  attachments.push_back(is_default_fbo ? GL_COLOR_EXT
482  : GL_COLOR_ATTACHMENT0);
483  }
484  if (pass_data.discard_depth_attachment && angle_safe) {
485  attachments.push_back(is_default_fbo ? GL_DEPTH_EXT
486  : GL_DEPTH_ATTACHMENT);
487  }
488 
489  if (pass_data.discard_stencil_attachment && angle_safe) {
490  attachments.push_back(is_default_fbo ? GL_STENCIL_EXT
491  : GL_STENCIL_ATTACHMENT);
492  }
493  gl.DiscardFramebufferEXT(GL_FRAMEBUFFER, // target
494  attachments.size(), // attachments to discard
495  attachments.data() // size
496  );
497  }
498 
499 #ifdef IMPELLER_DEBUG
500  if (is_default_fbo) {
501  tracer->MarkFrameEnd(gl);
502  }
503 #endif // IMPELLER_DEBUG
504 
505  return true;
506 }
507 
508 // |RenderPass|
509 bool RenderPassGLES::OnEncodeCommands(const Context& context) const {
510  if (!IsValid()) {
511  return false;
512  }
513  const auto& render_target = GetRenderTarget();
514  if (!render_target.HasColorAttachment(0u)) {
515  return false;
516  }
517  const auto& color0 = render_target.GetColorAttachments().at(0u);
518  const auto& depth0 = render_target.GetDepthAttachment();
519  const auto& stencil0 = render_target.GetStencilAttachment();
520 
521  auto pass_data = std::make_shared<RenderPassData>();
522  pass_data->label = label_;
523  pass_data->viewport.rect = Rect::MakeSize(GetRenderTargetSize());
524 
525  //----------------------------------------------------------------------------
526  /// Setup color data.
527  ///
528  pass_data->color_attachment = color0.texture;
529  pass_data->clear_color = color0.clear_color;
530  pass_data->clear_color_attachment = CanClearAttachment(color0.load_action);
531  pass_data->discard_color_attachment =
532  CanDiscardAttachmentWhenDone(color0.store_action);
533 
534  // When we are using EXT_multisampled_render_to_texture, it is implicitly
535  // resolved when we bind the texture to the framebuffer. We don't need to
536  // discard the attachment when we are done.
537  if (color0.resolve_texture) {
538  FML_DCHECK(context.GetCapabilities()->SupportsImplicitResolvingMSAA());
539  pass_data->discard_color_attachment = false;
540  }
541 
542  //----------------------------------------------------------------------------
543  /// Setup depth data.
544  ///
545  if (depth0.has_value()) {
546  pass_data->depth_attachment = depth0->texture;
547  pass_data->clear_depth = depth0->clear_depth;
548  pass_data->clear_depth_attachment = CanClearAttachment(depth0->load_action);
549  pass_data->discard_depth_attachment =
550  CanDiscardAttachmentWhenDone(depth0->store_action);
551  }
552 
553  //----------------------------------------------------------------------------
554  /// Setup stencil data.
555  ///
556  if (stencil0.has_value()) {
557  pass_data->stencil_attachment = stencil0->texture;
558  pass_data->clear_stencil = stencil0->clear_stencil;
559  pass_data->clear_stencil_attachment =
560  CanClearAttachment(stencil0->load_action);
561  pass_data->discard_stencil_attachment =
562  CanDiscardAttachmentWhenDone(stencil0->store_action);
563  }
564 
565  std::shared_ptr<const RenderPassGLES> shared_this = shared_from_this();
566  auto tracer = ContextGLES::Cast(context).GetGPUTracer();
567  return reactor_->AddOperation([pass_data,
568  allocator = context.GetResourceAllocator(),
569  render_pass = std::move(shared_this),
570  tracer](const auto& reactor) {
571  auto result = EncodeCommandsInReactor(*pass_data, allocator, reactor,
572  render_pass->commands_, tracer);
573  FML_CHECK(result) << "Must be able to encode GL commands without error.";
574  });
575 }
576 
577 } // namespace impeller
impeller::PipelineDescriptor
Definition: pipeline_descriptor.h:24
impeller::RenderPassData::discard_stencil_attachment
bool discard_stencil_attachment
Definition: render_pass_gles.cc:139
impeller::DeviceBufferGLES::BindingType::kArrayBuffer
@ kArrayBuffer
impeller::ReactorGLES::GetProcTable
const ProcTableGLES & GetProcTable() const
Get the OpenGL proc. table the reactor uses to manage handles.
Definition: reactor_gles.cc:48
impeller::PipelineDescriptor::GetBackStencilAttachmentDescriptor
std::optional< StencilAttachmentDescriptor > GetBackStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:243
impeller::ColorAttachmentDescriptor::src_color_blend_factor
BlendFactor src_color_blend_factor
Definition: formats.h:504
impeller::RenderPass::GetRenderTarget
const RenderTarget & GetRenderTarget() const
Definition: render_pass.cc:39
impeller::RenderPassGLES::~RenderPassGLES
~RenderPassGLES() override
impeller::RenderPassData::color_attachment
std::shared_ptr< Texture > color_attachment
Definition: render_pass_gles.cc:129
impeller::RenderPassData::label
std::string label
Definition: render_pass_gles.cc:141
impeller::RenderPassData::clear_depth
Scalar clear_depth
Definition: render_pass_gles.cc:127
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::CanClearAttachment
constexpr bool CanClearAttachment(LoadAction action)
Definition: formats.h:240
impeller::RenderPassData::clear_depth_attachment
bool clear_depth_attachment
Definition: render_pass_gles.cc:134
impeller::StencilAttachmentDescriptor::depth_failure
StencilOperation depth_failure
Definition: formats.h:607
impeller::StencilAttachmentDescriptor::stencil_compare
CompareFunction stencil_compare
Definition: formats.h:598
impeller::TextureGLES::AttachmentType::kDepth
@ kDepth
impeller::Color
Definition: color.h:124
impeller::RenderPassData::viewport
Viewport viewport
Definition: render_pass_gles.cc:123
impeller::ColorWriteMaskBits::kGreen
@ kGreen
impeller::ProcTableGLES::PushDebugGroup
void PushDebugGroup(const std::string &string) const
Definition: proc_table_gles.cc:374
impeller::ToBlendFactor
constexpr GLenum ToBlendFactor(BlendFactor factor)
Definition: formats_gles.h:91
impeller::ReactorGLES::Ref
std::shared_ptr< ReactorGLES > Ref
Definition: reactor_gles.h:87
impeller::RenderPassData::clear_stencil_attachment
bool clear_stencil_attachment
Definition: render_pass_gles.cc:135
texture_gles.h
impeller::RenderPassData::clear_stencil
uint32_t clear_stencil
Definition: render_pass_gles.cc:126
context_gles.h
impeller::ColorAttachmentDescriptor::alpha_blend_op
BlendOperation alpha_blend_op
Definition: formats.h:509
impeller::Color::alpha
Scalar alpha
Definition: color.h:143
impeller::WindingOrder::kClockwise
@ kClockwise
impeller::StencilAttachmentDescriptor::write_mask
uint32_t write_mask
Definition: formats.h:622
impeller::TextureGLES::AttachmentType::kColor0
@ kColor0
impeller::RenderPassData::stencil_attachment
std::shared_ptr< Texture > stencil_attachment
Definition: render_pass_gles.cc:131
impeller::RenderPassData
Encapsulates data that will be needed in the reactor for the encoding of commands for this render pas...
Definition: render_pass_gles.cc:122
impeller::RenderPassData::discard_depth_attachment
bool discard_depth_attachment
Definition: render_pass_gles.cc:138
validation.h
impeller::Color::green
Scalar green
Definition: color.h:133
impeller::Mask< ColorWriteMaskBits >
device_buffer_gles.h
impeller::RenderPass::GetRenderTargetSize
ISize GetRenderTargetSize() const
Definition: render_pass.cc:43
impeller::ToIndexType
constexpr GLenum ToIndexType(IndexType type)
Definition: formats_gles.h:34
gpu_tracer_gles.h
impeller::ToCompareFunction
constexpr GLenum ToCompareFunction(CompareFunction func)
Definition: formats_gles.h:69
impeller::CullMode::kBackFace
@ kBackFace
impeller::CullMode::kNone
@ kNone
impeller::StencilAttachmentDescriptor::read_mask
uint32_t read_mask
Definition: formats.h:617
impeller::RenderPassData::clear_color_attachment
bool clear_color_attachment
Definition: render_pass_gles.cc:133
impeller::PipelineDescriptor::HasStencilAttachmentDescriptors
bool HasStencilAttachmentDescriptors() const
Definition: pipeline_descriptor.cc:247
render_pass_gles.h
impeller::DeviceBufferGLES::BindingType::kElementArrayBuffer
@ kElementArrayBuffer
impeller::ToMode
constexpr GLenum ToMode(PrimitiveType primitive_type)
Definition: formats_gles.h:18
impeller::Color::red
Scalar red
Definition: color.h:128
impeller::WindingOrder::kCounterClockwise
@ kCounterClockwise
impeller::StencilAttachmentDescriptor::stencil_failure
StencilOperation stencil_failure
Definition: formats.h:602
impeller::IndexType::kNone
@ kNone
Does not use the index buffer.
impeller::StencilAttachmentDescriptor::depth_stencil_pass
StencilOperation depth_stencil_pass
Definition: formats.h:611
impeller::ProcTableGLES
Definition: proc_table_gles.h:229
impeller::CanDiscardAttachmentWhenDone
constexpr bool CanDiscardAttachmentWhenDone(StoreAction action)
Definition: formats.h:251
impeller::TextureGLES::AttachmentType::kStencil
@ kStencil
impeller::ColorAttachmentDescriptor::src_alpha_blend_factor
BlendFactor src_alpha_blend_factor
Definition: formats.h:508
formats_gles.h
impeller::Viewport
Definition: formats.h:398
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:73
impeller::CullMode::kFrontFace
@ kFrontFace
impeller::ColorWriteMaskBits::kAlpha
@ kAlpha
impeller::ColorAttachmentDescriptor::dst_color_blend_factor
BlendFactor dst_color_blend_factor
Definition: formats.h:506
impeller::PipelineDescriptor::GetFrontStencilAttachmentDescriptor
std::optional< StencilAttachmentDescriptor > GetFrontStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:202
impeller::ColorAttachmentDescriptor::dst_alpha_blend_factor
BlendFactor dst_alpha_blend_factor
Definition: formats.h:510
pipeline_gles.h
impeller::TRect< Scalar >::MakeSize
constexpr static TRect MakeSize(const TSize< U > &size)
Definition: rect.h:146
std
Definition: comparable.h:95
impeller::ConfigureBlending
void ConfigureBlending(const ProcTableGLES &gl, const ColorAttachmentDescriptor *color)
Definition: render_pass_gles.cc:43
impeller::BackendCast< TextureGLES, Texture >::Cast
static TextureGLES & Cast(Texture &base)
Definition: backend_cast.h:13
impeller::StencilAttachmentDescriptor
Definition: formats.h:592
impeller::ColorWriteMaskBits::kRed
@ kRed
impeller::ColorWriteMaskBits::kBlue
@ kBlue
impeller::ReactorGLES
The reactor attempts to make thread-safe usage of OpenGL ES easier to reason about.
Definition: reactor_gles.h:56
impeller::ConfigureStencil
void ConfigureStencil(GLenum face, const ProcTableGLES &gl, const StencilAttachmentDescriptor &stencil, uint32_t stencil_reference)
Definition: render_pass_gles.cc:76
impeller::PolygonMode::kLine
@ kLine
impeller::ContextGLES::GetGPUTracer
std::shared_ptr< GPUTracerGLES > GetGPUTracer() const
Definition: context_gles.h:44
impeller::ToBlendOperation
constexpr GLenum ToBlendOperation(BlendOperation op)
Definition: formats_gles.h:127
impeller::ColorAttachmentDescriptor::color_blend_op
BlendOperation color_blend_op
Definition: formats.h:505
impeller::TextureGLES::IsWrapped
IsWrapped
Definition: texture_gles.h:25
impeller::RenderPassData::depth_attachment
std::shared_ptr< Texture > depth_attachment
Definition: render_pass_gles.cc:130
impeller::RenderPassData::discard_color_attachment
bool discard_color_attachment
Definition: render_pass_gles.cc:137
impeller::Color::blue
Scalar blue
Definition: color.h:138
impeller::ToStencilOp
constexpr GLenum ToStencilOp(StencilOperation op)
Definition: formats_gles.h:47
impeller::EncodeCommandsInReactor
bool EncodeCommandsInReactor(const std::shared_ptr< Allocator > &transients_allocator, const ReactorGLES &reactor, const std::vector< std::unique_ptr< BlitEncodeGLES >> &commands, const std::string &label)
Definition: blit_pass_gles.cc:34
impeller
Definition: aiks_blur_unittests.cc:20
impeller::ColorAttachmentDescriptor::blending_enabled
bool blending_enabled
Definition: formats.h:502
impeller::IndexType::kUnknown
@ kUnknown
impeller::DebugToFramebufferError
std::string DebugToFramebufferError(int status)
Definition: formats_gles.cc:9
impeller::RenderPassData::clear_color
Color clear_color
Definition: render_pass_gles.cc:125
impeller::ColorAttachmentDescriptor::write_mask
ColorWriteMask write_mask
Definition: formats.h:512
impeller::ColorAttachmentDescriptor
Describe the color attachment that will be used with this pipeline.
Definition: formats.h:500