| 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
5 #include "impeller/renderer/backend/gles/render_pass_gles.h"
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"
13 #include "impeller/base/validation.h"
14 #include "impeller/renderer/backend/gles/context_gles.h"
15 #include "impeller/renderer/backend/gles/device_buffer_gles.h"
16 #include "impeller/renderer/backend/gles/formats_gles.h"
17 #include "impeller/renderer/backend/gles/gpu_tracer_gles.h"
18 #include "impeller/renderer/backend/gles/pipeline_gles.h"
19 #include "impeller/renderer/backend/gles/texture_gles.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|
31 RenderPassGLES::~RenderPassGLES() = default;
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
43 void ConfigureBlending(const ProcTableGLES& gl,
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
94 void ConfigureStencil(const ProcTableGLES& gl,
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 ///
122 struct RenderPassData {
123 Viewport viewport;
124
125 Color clear_color;
126 uint32_t clear_stencil = 0u;
127 Scalar clear_depth = 1.0;
128
129 std::shared_ptr<Texture> color_attachment;
130 std::shared_ptr<Texture> depth_attachment;
131 std::shared_ptr<Texture> stencil_attachment;
132
133 bool clear_color_attachment = true;
134 bool clear_depth_attachment = true;
135 bool clear_stencil_attachment = true;
136
137 bool discard_color_attachment = true;
138 bool discard_depth_attachment = true;
139 bool discard_stencil_attachment = true;
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 TextureGLES& color_gles = TextureGLES::Cast(*pass_data.color_attachment);
174 const bool is_default_fbo = color_gles.IsWrapped();
175
176 if (is_default_fbo) {
177 if (color_gles.GetFBO().has_value()) {
178 // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
179 gl.BindFramebuffer(GL_FRAMEBUFFER, *color_gles.GetFBO());
180 }
181 } else {
182 // Create and bind an offscreen FBO.
183 gl.GenFramebuffers(1u, &fbo);
184 gl.BindFramebuffer(GL_FRAMEBUFFER, fbo);
185
186 if (!color_gles.SetAsFramebufferAttachment(
187 GL_FRAMEBUFFER, TextureGLES::AttachmentType::kColor0)) {
188 return false;
189 }
190
191 if (auto depth = TextureGLES::Cast(pass_data.depth_attachment.get())) {
192 if (!depth->SetAsFramebufferAttachment(
193 GL_FRAMEBUFFER, TextureGLES::AttachmentType::kDepth)) {
194 return false;
195 }
196 }
197 if (auto stencil = TextureGLES::Cast(pass_data.stencil_attachment.get())) {
198 if (!stencil->SetAsFramebufferAttachment(
199 GL_FRAMEBUFFER, TextureGLES::AttachmentType::kStencil)) {
200 return false;
201 }
202 }
203
204 auto status = gl.CheckFramebufferStatus(GL_FRAMEBUFFER);
205 if (status != GL_FRAMEBUFFER_COMPLETE) {
206 VALIDATION_LOG << "Could not create a complete frambuffer: "
207 << DebugToFramebufferError(status);
208 return false;
209 }
210 }
211
212 gl.ClearColor(pass_data.clear_color.red, // red
213 pass_data.clear_color.green, // green
214 pass_data.clear_color.blue, // blue
215 pass_data.clear_color.alpha // alpha
216 );
217 if (pass_data.depth_attachment) {
218 if (gl.DepthRangef.IsAvailable()) {
219 gl.ClearDepthf(pass_data.clear_depth);
220 } else {
221 gl.ClearDepth(pass_data.clear_depth);
222 }
223 }
224 if (pass_data.stencil_attachment) {
225 gl.ClearStencil(pass_data.clear_stencil);
226 }
227
228 GLenum clear_bits = 0u;
229 if (pass_data.clear_color_attachment) {
230 clear_bits |= GL_COLOR_BUFFER_BIT;
231 }
232 if (pass_data.clear_depth_attachment) {
233 clear_bits |= GL_DEPTH_BUFFER_BIT;
234 }
235 if (pass_data.clear_stencil_attachment) {
236 clear_bits |= GL_STENCIL_BUFFER_BIT;
237 }
238
239 gl.Disable(GL_SCISSOR_TEST);
240 gl.Disable(GL_DEPTH_TEST);
241 gl.Disable(GL_STENCIL_TEST);
242 gl.Disable(GL_CULL_FACE);
243 gl.Disable(GL_BLEND);
244 gl.Disable(GL_DITHER);
245 gl.ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
246 gl.DepthMask(GL_TRUE);
247 gl.StencilMaskSeparate(GL_FRONT, 0xFFFFFFFF);
248 gl.StencilMaskSeparate(GL_BACK, 0xFFFFFFFF);
249
250 gl.Clear(clear_bits);
251
252 for (const auto& command : commands) {
253 if (command.instance_count != 1u) {
254 VALIDATION_LOG << "GLES backend does not support instanced rendering.";
255 return false;
256 }
257
258 if (!command.pipeline) {
259 VALIDATION_LOG << "Command has no pipeline specified.";
260 return false;
261 }
262
263 #ifdef IMPELLER_DEBUG
264 fml::ScopedCleanupClosure pop_cmd_debug_marker(
265 [&gl]() { gl.PopDebugGroup(); });
266 if (!command.label.empty()) {
267 gl.PushDebugGroup(command.label);
268 } else {
269 pop_cmd_debug_marker.Release();
270 }
271 #endif // IMPELLER_DEBUG
272
273 const auto& pipeline = PipelineGLES::Cast(*command.pipeline);
274
275 const auto* color_attachment =
276 pipeline.GetDescriptor().GetLegacyCompatibleColorAttachment();
277 if (!color_attachment) {
278 VALIDATION_LOG
279 << "Color attachment is too complicated for a legacy renderer.";
280 return false;
281 }
282
283 //--------------------------------------------------------------------------
284 /// Configure blending.
285 ///
286 ConfigureBlending(gl, color_attachment);
287
288 //--------------------------------------------------------------------------
289 /// Setup stencil.
290 ///
291 ConfigureStencil(gl, pipeline.GetDescriptor(), command.stencil_reference);
292
293 //--------------------------------------------------------------------------
294 /// Configure depth.
295 ///
296 if (auto depth =
297 pipeline.GetDescriptor().GetDepthStencilAttachmentDescriptor();
298 depth.has_value()) {
299 gl.Enable(GL_DEPTH_TEST);
300 gl.DepthFunc(ToCompareFunction(depth->depth_compare));
301 gl.DepthMask(depth->depth_write_enabled ? GL_TRUE : GL_FALSE);
302 } else {
303 gl.Disable(GL_DEPTH_TEST);
304 }
305
306 // Both the viewport and scissor are specified in framebuffer coordinates.
307 // Impeller's framebuffer coordinate system is top left origin, but OpenGL's
308 // is bottom left origin, so we convert the coordinates here.
309 auto target_size = pass_data.color_attachment->GetSize();
310
311 //--------------------------------------------------------------------------
312 /// Setup the viewport.
313 ///
314 const auto& viewport = command.viewport.value_or(pass_data.viewport);
315 gl.Viewport(viewport.rect.GetX(), // x
316 target_size.height - viewport.rect.GetY() -
317 viewport.rect.GetHeight(), // y
318 viewport.rect.GetWidth(), // width
319 viewport.rect.GetHeight() // height
320 );
321 if (pass_data.depth_attachment) {
322 if (gl.DepthRangef.IsAvailable()) {
323 gl.DepthRangef(viewport.depth_range.z_near, viewport.depth_range.z_far);
324 } else {
325 gl.DepthRange(viewport.depth_range.z_near, viewport.depth_range.z_far);
326 }
327 }
328
329 //--------------------------------------------------------------------------
330 /// Setup the scissor rect.
331 ///
332 if (command.scissor.has_value()) {
333 const auto& scissor = command.scissor.value();
334 gl.Enable(GL_SCISSOR_TEST);
335 gl.Scissor(
336 scissor.GetX(), // x
337 target_size.height - scissor.GetY() - scissor.GetHeight(), // y
338 scissor.GetWidth(), // width
339 scissor.GetHeight() // height
340 );
341 }
342
343 //--------------------------------------------------------------------------
344 /// Setup culling.
345 ///
346 switch (pipeline.GetDescriptor().GetCullMode()) {
347 case CullMode::kNone:
348 gl.Disable(GL_CULL_FACE);
349 break;
350 case CullMode::kFrontFace:
351 gl.Enable(GL_CULL_FACE);
352 gl.CullFace(GL_FRONT);
353 break;
354 case CullMode::kBackFace:
355 gl.Enable(GL_CULL_FACE);
356 gl.CullFace(GL_BACK);
357 break;
358 }
359 //--------------------------------------------------------------------------
360 /// Setup winding order.
361 ///
362 switch (pipeline.GetDescriptor().GetWindingOrder()) {
363 case WindingOrder::kClockwise:
364 gl.FrontFace(GL_CW);
365 break;
366 case WindingOrder::kCounterClockwise:
367 gl.FrontFace(GL_CCW);
368 break;
369 }
370
371 if (command.vertex_buffer.index_type == IndexType::kUnknown) {
372 return false;
373 }
374
375 auto vertex_desc_gles = pipeline.GetBufferBindings();
376
377 //--------------------------------------------------------------------------
378 /// Bind vertex and index buffers.
379 ///
380 auto& vertex_buffer_view = command.vertex_buffer.vertex_buffer;
381
382 if (!vertex_buffer_view) {
383 return false;
384 }
385
386 auto vertex_buffer = vertex_buffer_view.buffer;
387
388 if (!vertex_buffer) {
389 return false;
390 }
391
392 const auto& vertex_buffer_gles = DeviceBufferGLES::Cast(*vertex_buffer);
393 if (!vertex_buffer_gles.BindAndUploadDataIfNecessary(
394 DeviceBufferGLES::BindingType::kArrayBuffer)) {
395 return false;
396 }
397
398 //--------------------------------------------------------------------------
399 /// Bind the pipeline program.
400 ///
401 if (!pipeline.BindProgram()) {
402 return false;
403 }
404
405 //--------------------------------------------------------------------------
406 /// Bind vertex attribs.
407 ///
408 if (!vertex_desc_gles->BindVertexAttributes(
409 gl, vertex_buffer_view.range.offset)) {
410 return false;
411 }
412
413 //--------------------------------------------------------------------------
414 /// Bind uniform data.
415 ///
416 if (!vertex_desc_gles->BindUniformData(gl, //
417 *transients_allocator, //
418 command.vertex_bindings, //
419 command.fragment_bindings //
420 )) {
421 return false;
422 }
423
424 //--------------------------------------------------------------------------
425 /// Determine the primitive type.
426 ///
427 // GLES doesn't support setting the fill mode, so override the primitive
428 // with GL_LINE_STRIP to somewhat emulate PolygonMode::kLine. This isn't
429 // correct; full triangle outlines won't be drawn and disconnected
430 // geometry may appear connected. However this can still be useful for
431 // wireframe debug views.
432 auto mode = pipeline.GetDescriptor().GetPolygonMode() == PolygonMode::kLine
433 ? GL_LINE_STRIP
434 : ToMode(pipeline.GetDescriptor().GetPrimitiveType());
435
436 //--------------------------------------------------------------------------
437 /// Finally! Invoke the draw call.
438 ///
439 if (command.vertex_buffer.index_type == IndexType::kNone) {
440 gl.DrawArrays(mode, command.base_vertex,
441 command.vertex_buffer.vertex_count);
442 } else {
443 // Bind the index buffer if necessary.
444 auto index_buffer_view = command.vertex_buffer.index_buffer;
445 auto index_buffer = index_buffer_view.buffer;
446 const auto& index_buffer_gles = DeviceBufferGLES::Cast(*index_buffer);
447 if (!index_buffer_gles.BindAndUploadDataIfNecessary(
448 DeviceBufferGLES::BindingType::kElementArrayBuffer)) {
449 return false;
450 }
451 gl.DrawElements(mode, // mode
452 command.vertex_buffer.vertex_count, // count
453 ToIndexType(command.vertex_buffer.index_type), // type
454 reinterpret_cast<const GLvoid*>(static_cast<GLsizei>(
455 index_buffer_view.range.offset)) // indices
456 );
457 }
458
459 //--------------------------------------------------------------------------
460 /// Unbind vertex attribs.
461 ///
462 if (!vertex_desc_gles->UnbindVertexAttributes(gl)) {
463 return false;
464 }
465
466 //--------------------------------------------------------------------------
467 /// Unbind the program pipeline.
468 ///
469 if (!pipeline.UnbindProgram()) {
470 return false;
471 }
472 }
473
474 if (gl.DiscardFramebufferEXT.IsAvailable()) {
475 std::vector<GLenum> attachments;
476
477 // TODO(130048): discarding stencil or depth on the default fbo causes Angle
478 // to discard the entire render target. Until we know the reason, default to
479 // storing.
480 bool angle_safe = gl.GetCapabilities()->IsANGLE() ? !is_default_fbo : true;
481
482 if (pass_data.discard_color_attachment) {
483 attachments.push_back(is_default_fbo ? GL_COLOR_EXT
484 : GL_COLOR_ATTACHMENT0);
485 }
486 if (pass_data.discard_depth_attachment && angle_safe) {
487 attachments.push_back(is_default_fbo ? GL_DEPTH_EXT
488 : GL_DEPTH_ATTACHMENT);
489 }
490
491 if (pass_data.discard_stencil_attachment && angle_safe) {
492 attachments.push_back(is_default_fbo ? GL_STENCIL_EXT
493 : GL_STENCIL_ATTACHMENT);
494 }
495 gl.DiscardFramebufferEXT(GL_FRAMEBUFFER, // target
496 attachments.size(), // attachments to discard
497 attachments.data() // size
498 );
499 }
500
501 #ifdef IMPELLER_DEBUG
502 if (is_default_fbo) {
503 tracer->MarkFrameEnd(gl);
504 }
505 #endif // IMPELLER_DEBUG
506
507 return true;
508 }
509
510 // |RenderPass|
511 bool RenderPassGLES::OnEncodeCommands(const Context& context) const {
512 if (!IsValid()) {
513 return false;
514 }
515 const auto& render_target = GetRenderTarget();
516 if (!render_target.HasColorAttachment(0u)) {
517 return false;
518 }
519 const auto& color0 = render_target.GetColorAttachments().at(0u);
520 const auto& depth0 = render_target.GetDepthAttachment();
521 const auto& stencil0 = render_target.GetStencilAttachment();
522
523 auto pass_data = std::make_shared<RenderPassData>();
524 pass_data->label = label_;
525 pass_data->viewport.rect = Rect::MakeSize(GetRenderTargetSize());
526
527 //----------------------------------------------------------------------------
528 /// Setup color data.
529 ///
530 pass_data->color_attachment = color0.texture;
531 pass_data->clear_color = color0.clear_color;
532 pass_data->clear_color_attachment = CanClearAttachment(color0.load_action);
533 pass_data->discard_color_attachment =
534 CanDiscardAttachmentWhenDone(color0.store_action);
535
536 // When we are using EXT_multisampled_render_to_texture, it is implicitly
537 // resolved when we bind the texture to the framebuffer. We don't need to
538 // discard the attachment when we are done.
539 if (color0.resolve_texture) {
540 FML_DCHECK(context.GetCapabilities()->SupportsImplicitResolvingMSAA());
541 pass_data->discard_color_attachment = false;
542 }
543
544 //----------------------------------------------------------------------------
545 /// Setup depth data.
546 ///
547 if (depth0.has_value()) {
548 pass_data->depth_attachment = depth0->texture;
549 pass_data->clear_depth = depth0->clear_depth;
550 pass_data->clear_depth_attachment = CanClearAttachment(depth0->load_action);
551 pass_data->discard_depth_attachment =
552 CanDiscardAttachmentWhenDone(depth0->store_action);
553 }
554
555 //----------------------------------------------------------------------------
556 /// Setup stencil data.
557 ///
558 if (stencil0.has_value()) {
559 pass_data->stencil_attachment = stencil0->texture;
560 pass_data->clear_stencil = stencil0->clear_stencil;
561 pass_data->clear_stencil_attachment =
562 CanClearAttachment(stencil0->load_action);
563 pass_data->discard_stencil_attachment =
564 CanDiscardAttachmentWhenDone(stencil0->store_action);
565 }
566
567 std::shared_ptr<const RenderPassGLES> shared_this = shared_from_this();
568 auto tracer = ContextGLES::Cast(context).GetGPUTracer();
569 return reactor_->AddOperation([pass_data,
570 allocator = context.GetResourceAllocator(),
571 render_pass = std::move(shared_this),
572 tracer](const auto& reactor) {
573 auto result = EncodeCommandsInReactor(*pass_data, allocator, reactor,
574 render_pass->commands_, tracer);
575 FML_CHECK(result) << "Must be able to encode GL commands without error.";
576 });
577 }
578
579 } // 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::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:239
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:625
impeller::StencilAttachmentDescriptor::stencil_compare
CompareFunction stencil_compare
Definition: formats.h:616
impeller::TextureGLES::AttachmentType::kDepth
@ kDepth
impeller::Color
Definition: color.h:123
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:92
impeller::ReactorGLES::Ref
std::shared_ptr< ReactorGLES > Ref
Definition: reactor_gles.h:86
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::Color::alpha
Scalar alpha
Definition: color.h:142
impeller::WindingOrder::kClockwise
@ kClockwise
impeller::StencilAttachmentDescriptor::write_mask
uint32_t write_mask
Definition: formats.h:640
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:132
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:35
gpu_tracer_gles.h
impeller::ToCompareFunction
constexpr GLenum ToCompareFunction(CompareFunction func)
Definition: formats_gles.h:70
impeller::CullMode::kBackFace
@ kBackFace
impeller::CullMode::kNone
@ kNone
impeller::StencilAttachmentDescriptor::read_mask
uint32_t read_mask
Definition: formats.h:635
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:17
impeller::Color::red
Scalar red
Definition: color.h:127
impeller::WindingOrder::kCounterClockwise
@ kCounterClockwise
impeller::StencilAttachmentDescriptor::stencil_failure
StencilOperation stencil_failure
Definition: formats.h:620
impeller::IndexType::kNone
@ kNone
Does not use the index buffer.
impeller::StencilAttachmentDescriptor::depth_stencil_pass
StencilOperation depth_stencil_pass
Definition: formats.h:629
impeller::ProcTableGLES
Definition: proc_table_gles.h:226
impeller::CanDiscardAttachmentWhenDone
constexpr bool CanDiscardAttachmentWhenDone(StoreAction action)
Definition: formats.h:250
impeller::TextureGLES::AttachmentType::kStencil
@ kStencil
formats_gles.h
impeller::Viewport
Definition: formats.h:403
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91
impeller::CullMode::kFrontFace
@ kFrontFace
impeller::ColorWriteMaskBits::kAlpha
@ kAlpha
impeller::PipelineDescriptor::GetFrontStencilAttachmentDescriptor
std::optional< StencilAttachmentDescriptor > GetFrontStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:202
pipeline_gles.h
impeller::TRect< Scalar >::MakeSize
constexpr static TRect MakeSize(const TSize< U > &size)
Definition: rect.h:150
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:610
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:55
impeller::ConfigureStencil
void ConfigureStencil(GLenum face, const ProcTableGLES &gl, const StencilAttachmentDescriptor &stencil, uint32_t stencil_reference)
Definition: render_pass_gles.cc:76
color
DlColor color
Definition: dl_golden_blur_unittests.cc:24
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:128
impeller::TextureGLES
Definition: texture_gles.h:17
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:137
impeller::ToStencilOp
constexpr GLenum ToStencilOp(StencilOperation op)
Definition: formats_gles.h:48
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: allocation.cc:12
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
Describe the color attachment that will be used with this pipeline.
Definition: formats.h:518