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