Flutter Engine
 
Loading...
Searching...
No Matches
render_pass.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#include <future>
7#include <memory>
8
12#include "fml/make_copyable.h"
13#include "fml/memory/ref_ptr.h"
23#include "lib/gpu/context.h"
26
27namespace flutter {
28namespace gpu {
29
31
32RenderPass::RenderPass() = default;
33
34RenderPass::~RenderPass() = default;
35
36const std::shared_ptr<const impeller::Context>& RenderPass::GetContext() const {
37 return render_pass_->GetContext();
38}
39
41 return render_target_;
42}
43
45 return render_target_;
46}
47
49 size_t color_attachment_index) {
50 auto color = color_descriptors_.find(color_attachment_index);
51 if (color == color_descriptors_.end()) {
52 return color_descriptors_[color_attachment_index] = {};
53 }
54 return color->second;
55}
56
59 return depth_desc_;
60}
61
64 return stencil_front_desc_;
65}
66
69 return stencil_back_desc_;
70}
71
73 return pipeline_descriptor_;
74}
75
77 render_pass_ =
78 command_buffer.GetCommandBuffer()->CreateRenderPass(render_target_);
79 if (!render_pass_) {
80 return false;
81 }
82 command_buffer.AddRenderPass(render_pass_);
83 return true;
84}
85
87 // On debug this makes a difference, but not on release builds.
88 // NOLINTNEXTLINE(performance-move-const-arg)
89 render_pipeline_ = std::move(pipeline);
90}
91
102
103std::shared_ptr<impeller::Pipeline<impeller::PipelineDescriptor>>
104RenderPass::GetOrCreatePipeline() {
105 // Infer the pipeline layout based on the shape of the RenderTarget.
106 auto pipeline_desc = pipeline_descriptor_;
107
108 pipeline_desc.SetSampleCount(render_target_.GetSampleCount());
109
110 render_target_.IterateAllColorAttachments(
111 [&](size_t index, const impeller::ColorAttachment& attachment) -> bool {
112 auto& color = GetColorAttachmentDescriptor(index);
113 color.format = render_target_.GetRenderTargetPixelFormat();
114 return true;
115 });
116
117 pipeline_desc.SetColorAttachmentDescriptors(color_descriptors_);
118
119 {
120 auto stencil = render_target_.GetStencilAttachment();
121 if (stencil && impeller::IsStencilWritable(
122 stencil->texture->GetTextureDescriptor().format)) {
123 pipeline_desc.SetStencilPixelFormat(
124 stencil->texture->GetTextureDescriptor().format);
125 pipeline_desc.SetStencilAttachmentDescriptors(stencil_front_desc_,
126 stencil_back_desc_);
127 } else {
128 pipeline_desc.ClearStencilAttachments();
129 }
130 }
131
132 {
133 auto depth = render_target_.GetDepthAttachment();
134 if (depth && impeller::IsDepthWritable(
135 depth->texture->GetTextureDescriptor().format)) {
136 pipeline_desc.SetDepthPixelFormat(
137 depth->texture->GetTextureDescriptor().format);
138 pipeline_desc.SetDepthStencilAttachmentDescriptor(depth_desc_);
139 } else {
140 pipeline_desc.ClearDepthAttachment();
141 }
142 }
143
144 auto& context = *GetContext();
145
146 render_pipeline_->BindToPipelineDescriptor(*context.GetShaderLibrary(),
147 pipeline_desc);
148
149 std::shared_ptr<impeller::Pipeline<impeller::PipelineDescriptor>> pipeline;
150
151 if (context.GetBackendType() == impeller::Context::BackendType::kOpenGLES &&
152 !context.GetPipelineLibrary()->HasPipeline(pipeline_desc)) {
153 // For GLES, new pipeline creation must be done on the reactor (raster)
154 // thread. We're about the draw, so we need to synchronize with a raster
155 // task in order to get the new pipeline. Depending on how busy the raster
156 // thread is, this could hang the UI thread long enough to miss a frame.
157
158 // Note that this branch is only called if a new pipeline actually needs to
159 // be built.
160 auto dart_state = flutter::UIDartState::Current();
161 std::promise<
162 std::shared_ptr<impeller::Pipeline<impeller::PipelineDescriptor>>>
163 pipeline_promise;
164 auto pipeline_future = pipeline_promise.get_future();
166 dart_state->GetTaskRunners().GetRasterTaskRunner(),
167 fml::MakeCopyable([promise = std::move(pipeline_promise),
168 context = GetContext(), pipeline_desc]() mutable {
169 promise.set_value(context->GetPipelineLibrary()
170 ->GetPipeline(pipeline_desc, true, true)
171 .Get());
172 }));
173 pipeline = pipeline_future.get();
174 } else {
175 pipeline = context.GetPipelineLibrary()->GetPipeline(pipeline_desc).Get();
176 }
177
178 FML_DCHECK(pipeline) << "Couldn't resolve render pipeline";
179 return pipeline;
180}
181
183 render_pass_->SetPipeline(impeller::PipelineRef(GetOrCreatePipeline()));
184
185 for (const auto& [_, buffer] : vertex_uniform_bindings) {
186 render_pass_->BindDynamicResource(
189 std::make_unique<impeller::ShaderMetadata>(*buffer.view.GetMetadata()),
190 buffer.view.resource);
191 }
192 for (const auto& [_, texture] : vertex_texture_bindings) {
193 render_pass_->BindDynamicResource(
195 texture.slot,
196 std::make_unique<impeller::ShaderMetadata>(
197 *texture.texture.GetMetadata()),
198 texture.texture.resource, texture.sampler);
199 }
200 for (const auto& [_, buffer] : fragment_uniform_bindings) {
201 render_pass_->BindDynamicResource(
204 std::make_unique<impeller::ShaderMetadata>(*buffer.view.GetMetadata()),
205 buffer.view.resource);
206 }
207 for (const auto& [_, texture] : fragment_texture_bindings) {
208 render_pass_->BindDynamicResource(
211 std::make_unique<impeller::ShaderMetadata>(
212 *texture.texture.GetMetadata()),
213 texture.texture.resource, texture.sampler);
214 }
215
216 render_pass_->SetVertexBuffer(vertex_buffer);
217 render_pass_->SetIndexBuffer(index_buffer, index_buffer_type);
218 render_pass_->SetElementCount(element_count);
219
220 render_pass_->SetStencilReference(stencil_reference);
221
222 if (viewport.has_value()) {
223 render_pass_->SetViewport(viewport.value());
224 }
225
226 if (scissor.has_value()) {
227 render_pass_->SetScissor(scissor.value());
228 }
229
230 bool result = render_pass_->Draw().ok();
231
232 return result;
233}
234
235} // namespace gpu
236} // namespace flutter
237
238//----------------------------------------------------------------------------
239/// Exports
240///
241
243 auto res = fml::MakeRefCounted<flutter::gpu::RenderPass>();
244 res->AssociateWithDartWrapper(wrapper);
245}
246
249 flutter::gpu::Context* context,
250 int color_attachment_index,
251 int load_action,
252 int store_action,
253 float clear_color_r,
254 float clear_color_g,
255 float clear_color_b,
256 float clear_color_a,
258 Dart_Handle resolve_texture_wrapper) {
262 desc.clear_color = impeller::Color(clear_color_r, clear_color_g,
263 clear_color_b, clear_color_a);
264 desc.texture = texture->GetTexture();
265 if (!Dart_IsNull(resolve_texture_wrapper)) {
266 flutter::gpu::Texture* resolve_texture =
268 resolve_texture_wrapper);
269 desc.resolve_texture = resolve_texture->GetTexture();
270
271 // If the backend doesn't support normal MSAA, gracefully fallback to
272 // rendering without MSAA.
274 desc.texture = desc.resolve_texture;
275 desc.resolve_texture = nullptr;
277 }
278 }
279 wrapper->GetRenderTarget().SetColorAttachment(desc, color_attachment_index);
280 return Dart_Null();
281}
282
285 int depth_load_action,
286 int depth_store_action,
287 float depth_clear_value,
288 int stencil_load_action,
289 int stencil_store_action,
290 int stencil_clear_value,
292 {
294 desc.load_action = flutter::gpu::ToImpellerLoadAction(depth_load_action);
295 desc.store_action = flutter::gpu::ToImpellerStoreAction(depth_store_action);
296 desc.clear_depth = depth_clear_value;
297 desc.texture = texture->GetTexture();
298 wrapper->GetRenderTarget().SetDepthAttachment(desc);
299 }
300 {
302 desc.load_action = flutter::gpu::ToImpellerLoadAction(stencil_load_action);
303 desc.store_action =
304 flutter::gpu::ToImpellerStoreAction(stencil_store_action);
305 desc.clear_stencil = stencil_clear_value;
306 desc.texture = texture->GetTexture();
307 wrapper->GetRenderTarget().SetStencilAttachment(desc);
308 }
309
310 return Dart_Null();
311}
312
315 flutter::gpu::CommandBuffer* command_buffer) {
316 if (!wrapper->Begin(*command_buffer)) {
317 return tonic::ToDart("Failed to begin RenderPass");
318 }
319 return Dart_Null();
320}
321
326 wrapper->SetPipeline(std::move(ref));
327}
328
331 const std::shared_ptr<const impeller::DeviceBuffer>& buffer,
332 int offset_in_bytes,
333 int length_in_bytes,
334 int vertex_count) {
336 buffer, impeller::Range(offset_in_bytes, length_in_bytes));
337
338 // If the index type is set, then the `vertex_count` becomes the index
339 // count... So don't overwrite the count if it's already been set when binding
340 // the index buffer.
341 // TODO(bdero): Consider just doing a more traditional API with
342 // draw(vertexCount) and drawIndexed(indexCount). This is fine,
343 // but overall it would be a bit more explicit and we wouldn't
344 // have to document this behavior where the presence of the index
345 // buffer always takes precedent.
346 if (!wrapper->has_index_buffer) {
347 wrapper->element_count = vertex_count;
348 }
349}
350
353 flutter::gpu::DeviceBuffer* device_buffer,
354 int offset_in_bytes,
355 int length_in_bytes,
356 int vertex_count) {
357 BindVertexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
358 length_in_bytes, vertex_count);
359}
360
361static void BindIndexBuffer(
363 const std::shared_ptr<const impeller::DeviceBuffer>& buffer,
364 int offset_in_bytes,
365 int length_in_bytes,
366 int index_type,
367 int index_count) {
370 buffer, impeller::Range(offset_in_bytes, length_in_bytes));
371 wrapper->index_buffer_type = type;
372
373 bool setting_index_buffer = type != impeller::IndexType::kNone;
374 if (setting_index_buffer) {
375 wrapper->element_count = index_count;
376 }
377 wrapper->has_index_buffer = setting_index_buffer;
378}
379
382 flutter::gpu::DeviceBuffer* device_buffer,
383 int offset_in_bytes,
384 int length_in_bytes,
385 int index_type,
386 int index_count) {
387 BindIndexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
388 length_in_bytes, index_type, index_count);
389}
390
391static bool BindUniform(
393 flutter::gpu::Shader* shader,
394 Dart_Handle uniform_name_handle,
395 const std::shared_ptr<const impeller::DeviceBuffer>& buffer,
396 int offset_in_bytes,
397 int length_in_bytes) {
398 auto uniform_name = tonic::StdStringFromDart(uniform_name_handle);
399 const flutter::gpu::Shader::UniformBinding* uniform_struct =
400 shader->GetUniformStruct(uniform_name);
401 // TODO(bdero): Return an error string stating that no uniform struct with
402 // this name exists and throw an exception.
403 if (!uniform_struct) {
404 return false;
405 }
406
407 flutter::gpu::RenderPass::BufferUniformMap* uniform_map = nullptr;
408 switch (shader->GetShaderStage()) {
410 uniform_map = &wrapper->vertex_uniform_bindings;
411 break;
413 uniform_map = &wrapper->fragment_uniform_bindings;
414 break;
417 return false;
418 }
419
420 if (!buffer || static_cast<size_t>(offset_in_bytes + length_in_bytes) >
421 buffer->GetDeviceBufferDescriptor().size) {
422 return false;
423 }
424
425 uniform_map->insert_or_assign(
426 uniform_struct,
428 .slot = uniform_struct->slot,
430 &uniform_struct->metadata,
432 buffer, impeller::Range(offset_in_bytes, length_in_bytes)),
433 }});
434 return true;
435}
436
439 flutter::gpu::Shader* shader,
440 Dart_Handle uniform_name_handle,
441 flutter::gpu::DeviceBuffer* device_buffer,
442 int offset_in_bytes,
443 int length_in_bytes) {
444 return BindUniform(wrapper, shader, uniform_name_handle,
445 device_buffer->GetBuffer(), offset_in_bytes,
446 length_in_bytes);
447}
448
451 flutter::gpu::Shader* shader,
452 Dart_Handle uniform_name_handle,
454 int min_filter,
455 int mag_filter,
456 int mip_filter,
457 int width_address_mode,
458 int height_address_mode) {
459 auto uniform_name = tonic::StdStringFromDart(uniform_name_handle);
460 const flutter::gpu::Shader::TextureBinding* texture_binding =
461 shader->GetUniformTexture(uniform_name);
462 // TODO(bdero): Return an error string stating that no uniform texture with
463 // this name exists and throw an exception.
464 if (!texture_binding) {
465 return false;
466 }
467
468 impeller::SamplerDescriptor sampler_desc;
469 sampler_desc.min_filter = flutter::gpu::ToImpellerMinMagFilter(min_filter);
470 sampler_desc.mag_filter = flutter::gpu::ToImpellerMinMagFilter(mag_filter);
471 sampler_desc.mip_filter = flutter::gpu::ToImpellerMipFilter(mip_filter);
472 sampler_desc.width_address_mode =
474 sampler_desc.height_address_mode =
476 auto sampler =
477 wrapper->GetContext()->GetSamplerLibrary()->GetSampler(sampler_desc);
478
479 flutter::gpu::RenderPass::TextureUniformMap* uniform_map = nullptr;
480 switch (shader->GetShaderStage()) {
482 uniform_map = &wrapper->vertex_texture_bindings;
483 break;
485 uniform_map = &wrapper->fragment_texture_bindings;
486 break;
489 return false;
490 }
491 uniform_map->insert_or_assign(
492 texture_binding,
494 .slot = texture_binding->slot,
495 .texture = {&texture_binding->metadata, texture->GetTexture()},
496 .sampler = sampler,
497 });
498 return true;
499}
500
505
508 int color_attachment_index,
509 bool enable) {
510 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
511 color.blending_enabled = enable;
512}
513
516 int color_attachment_index,
517 int color_blend_operation,
518 int source_color_blend_factor,
519 int destination_color_blend_factor,
520 int alpha_blend_operation,
521 int source_alpha_blend_factor,
522 int destination_alpha_blend_factor) {
523 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
524 color.color_blend_op =
525 flutter::gpu::ToImpellerBlendOperation(color_blend_operation);
526 color.src_color_blend_factor =
527 flutter::gpu::ToImpellerBlendFactor(source_color_blend_factor);
528 color.dst_color_blend_factor =
529 flutter::gpu::ToImpellerBlendFactor(destination_color_blend_factor);
530 color.alpha_blend_op =
531 flutter::gpu::ToImpellerBlendOperation(alpha_blend_operation);
532 color.src_alpha_blend_factor =
533 flutter::gpu::ToImpellerBlendFactor(source_alpha_blend_factor);
534 color.dst_alpha_blend_factor =
535 flutter::gpu::ToImpellerBlendFactor(destination_alpha_blend_factor);
536}
537
540 bool enable) {
541 auto& depth = wrapper->GetDepthAttachmentDescriptor();
542 depth.depth_write_enabled = true;
543}
544
547 int compare_operation) {
548 auto& depth = wrapper->GetDepthAttachmentDescriptor();
549 depth.depth_compare =
551}
552
555 int stencil_reference) {
556 wrapper->stencil_reference = static_cast<uint32_t>(stencil_reference);
557}
558
560 int x,
561 int y,
562 int width,
563 int height) {
565}
566
569 int x,
570 int y,
571 int width,
572 int height,
573 float z_near,
574 float z_far) {
576
577 auto depth_range = impeller::DepthRange();
578 depth_range.z_near = z_near;
579 depth_range.z_far = z_far;
580
581 auto viewport = impeller::Viewport();
582 viewport.rect = rect;
583 viewport.depth_range = depth_range;
584
585 wrapper->viewport = viewport;
586}
587
590 int stencil_compare_operation,
591 int stencil_fail_operation,
592 int depth_fail_operation,
593 int depth_stencil_pass_operation,
594 int read_mask,
595 int write_mask,
596 int target_face) {
598 desc.stencil_compare =
599 flutter::gpu::ToImpellerCompareFunction(stencil_compare_operation);
600 desc.stencil_failure =
601 flutter::gpu::ToImpellerStencilOperation(stencil_fail_operation);
602 desc.depth_failure =
603 flutter::gpu::ToImpellerStencilOperation(depth_fail_operation);
604 desc.depth_stencil_pass =
605 flutter::gpu::ToImpellerStencilOperation(depth_stencil_pass_operation);
606 desc.read_mask = static_cast<uint32_t>(read_mask);
607 desc.write_mask = static_cast<uint32_t>(write_mask);
608
609 // Corresponds to the `StencilFace` enum in `gpu/lib/src/render_pass.dart`.
610 if (target_face != 2 /* both or front */) {
611 wrapper->GetStencilFrontAttachmentDescriptor() = desc;
612 }
613 if (target_face != 1 /* both or back */) {
614 wrapper->GetStencilBackAttachmentDescriptor() = desc;
615 }
616}
617
620 int cull_mode) {
621 impeller::PipelineDescriptor& pipeline_descriptor =
622 wrapper->GetPipelineDescriptor();
623 pipeline_descriptor.SetCullMode(flutter::gpu::ToImpellerCullMode(cull_mode));
624}
625
628 int primitive_type) {
629 impeller::PipelineDescriptor& pipeline_descriptor =
630 wrapper->GetPipelineDescriptor();
631 pipeline_descriptor.SetPrimitiveType(
633}
634
637 int winding_order) {
638 impeller::PipelineDescriptor& pipeline_descriptor =
639 wrapper->GetPipelineDescriptor();
640 pipeline_descriptor.SetWindingOrder(
642}
643
646 int polygon_mode) {
647 impeller::PipelineDescriptor& pipeline_descriptor =
648 wrapper->GetPipelineDescriptor();
649 pipeline_descriptor.SetPolygonMode(
651}
652
654 return wrapper->Draw();
655}
GLenum type
static UIDartState * Current()
std::shared_ptr< impeller::CommandBuffer > GetCommandBuffer()
void AddRenderPass(std::shared_ptr< impeller::RenderPass > render_pass)
impeller::Context & GetContext()
Definition context.cc:77
std::shared_ptr< impeller::DeviceBuffer > GetBuffer()
std::optional< impeller::Viewport > viewport
Definition render_pass.h:84
impeller::StencilAttachmentDescriptor & GetStencilBackAttachmentDescriptor()
void SetPipeline(fml::RefPtr< RenderPipeline > pipeline)
impeller::RenderTarget & GetRenderTarget()
bool Begin(flutter::gpu::CommandBuffer &command_buffer)
std::unordered_map< const flutter::gpu::Shader::UniformBinding *, BufferAndUniformSlot > BufferUniformMap
Definition render_pass.h:67
impeller::BufferView vertex_buffer
Definition render_pass.h:77
impeller::DepthAttachmentDescriptor & GetDepthAttachmentDescriptor()
std::unordered_map< const flutter::gpu::Shader::TextureBinding *, impeller::TextureAndSampler > TextureUniformMap
Definition render_pass.h:70
std::optional< impeller::IRect32 > scissor
Definition render_pass.h:83
TextureUniformMap fragment_texture_bindings
Definition render_pass.h:75
BufferUniformMap fragment_uniform_bindings
Definition render_pass.h:74
TextureUniformMap vertex_texture_bindings
Definition render_pass.h:73
BufferUniformMap vertex_uniform_bindings
Definition render_pass.h:72
impeller::IndexType index_buffer_type
Definition render_pass.h:79
impeller::StencilAttachmentDescriptor & GetStencilFrontAttachmentDescriptor()
impeller::ColorAttachmentDescriptor & GetColorAttachmentDescriptor(size_t color_attachment_index)
impeller::PipelineDescriptor & GetPipelineDescriptor()
const std::shared_ptr< const impeller::Context > & GetContext() const
impeller::BufferView index_buffer
Definition render_pass.h:78
An immutable collection of shaders loaded from a shader bundle asset.
Definition shader.h:23
const Shader::UniformBinding * GetUniformStruct(const std::string &name) const
Definition shader.cc:105
impeller::ShaderStage GetShaderStage() const
Definition shader.cc:96
const Shader::TextureBinding * GetUniformTexture(const std::string &name) const
Definition shader.cc:114
std::shared_ptr< impeller::Texture > GetTexture()
Definition texture.cc:29
static void RunNowOrPostTask(const fml::RefPtr< fml::TaskRunner > &runner, const fml::closure &task)
void SetPolygonMode(PolygonMode mode)
PipelineDescriptor & SetSampleCount(SampleCount samples)
void SetPrimitiveType(PrimitiveType type)
void SetWindingOrder(WindingOrder order)
SampleCount GetSampleCount() const
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
PixelFormat GetRenderTargetPixelFormat() const
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
bool IterateAllColorAttachments(const std::function< bool(size_t index, const ColorAttachment &attachment)> &iterator) const
const std::optional< DepthAttachment > & GetDepthAttachment() const
const std::optional< StencilAttachment > & GetStencilAttachment() const
#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName)
int32_t x
#define FML_DCHECK(condition)
Definition logging.h:122
void InternalFlutterGpu_RenderPass_BindPipeline(flutter::gpu::RenderPass *wrapper, flutter::gpu::RenderPipeline *pipeline)
static bool BindUniform(flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, const std::shared_ptr< const impeller::DeviceBuffer > &buffer, int offset_in_bytes, int length_in_bytes)
void InternalFlutterGpu_RenderPass_ClearBindings(flutter::gpu::RenderPass *wrapper)
static void BindIndexBuffer(flutter::gpu::RenderPass *wrapper, const std::shared_ptr< const impeller::DeviceBuffer > &buffer, int offset_in_bytes, int length_in_bytes, int index_type, int index_count)
void InternalFlutterGpu_RenderPass_SetStencilConfig(flutter::gpu::RenderPass *wrapper, int stencil_compare_operation, int stencil_fail_operation, int depth_fail_operation, int depth_stencil_pass_operation, int read_mask, int write_mask, int target_face)
void InternalFlutterGpu_RenderPass_SetPrimitiveType(flutter::gpu::RenderPass *wrapper, int primitive_type)
void InternalFlutterGpu_RenderPass_SetColorBlendEquation(flutter::gpu::RenderPass *wrapper, int color_attachment_index, int color_blend_operation, int source_color_blend_factor, int destination_color_blend_factor, int alpha_blend_operation, int source_alpha_blend_factor, int destination_alpha_blend_factor)
void InternalFlutterGpu_RenderPass_BindVertexBufferDevice(flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int vertex_count)
void InternalFlutterGpu_RenderPass_BindIndexBufferDevice(flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int index_type, int index_count)
static void BindVertexBuffer(flutter::gpu::RenderPass *wrapper, const std::shared_ptr< const impeller::DeviceBuffer > &buffer, int offset_in_bytes, int length_in_bytes, int vertex_count)
void InternalFlutterGpu_RenderPass_SetStencilReference(flutter::gpu::RenderPass *wrapper, int stencil_reference)
bool InternalFlutterGpu_RenderPass_BindTexture(flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, flutter::gpu::Texture *texture, int min_filter, int mag_filter, int mip_filter, int width_address_mode, int height_address_mode)
Dart_Handle InternalFlutterGpu_RenderPass_Begin(flutter::gpu::RenderPass *wrapper, flutter::gpu::CommandBuffer *command_buffer)
void InternalFlutterGpu_RenderPass_SetDepthCompareOperation(flutter::gpu::RenderPass *wrapper, int compare_operation)
void InternalFlutterGpu_RenderPass_SetCullMode(flutter::gpu::RenderPass *wrapper, int cull_mode)
void InternalFlutterGpu_RenderPass_SetPolygonMode(flutter::gpu::RenderPass *wrapper, int polygon_mode)
bool InternalFlutterGpu_RenderPass_BindUniformDevice(flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes)
void InternalFlutterGpu_RenderPass_SetWindingOrder(flutter::gpu::RenderPass *wrapper, int winding_order)
void InternalFlutterGpu_RenderPass_SetScissor(flutter::gpu::RenderPass *wrapper, int x, int y, int width, int height)
void InternalFlutterGpu_RenderPass_SetColorBlendEnable(flutter::gpu::RenderPass *wrapper, int color_attachment_index, bool enable)
void InternalFlutterGpu_RenderPass_Initialize(Dart_Handle wrapper)
void InternalFlutterGpu_RenderPass_SetDepthWriteEnable(flutter::gpu::RenderPass *wrapper, bool enable)
Dart_Handle InternalFlutterGpu_RenderPass_SetDepthStencilAttachment(flutter::gpu::RenderPass *wrapper, int depth_load_action, int depth_store_action, float depth_clear_value, int stencil_load_action, int stencil_store_action, int stencil_clear_value, flutter::gpu::Texture *texture)
bool InternalFlutterGpu_RenderPass_Draw(flutter::gpu::RenderPass *wrapper)
Dart_Handle InternalFlutterGpu_RenderPass_SetColorAttachment(flutter::gpu::RenderPass *wrapper, flutter::gpu::Context *context, int color_attachment_index, int load_action, int store_action, float clear_color_r, float clear_color_g, float clear_color_b, float clear_color_a, flutter::gpu::Texture *texture, Dart_Handle resolve_texture_wrapper)
void InternalFlutterGpu_RenderPass_SetViewport(flutter::gpu::RenderPass *wrapper, int x, int y, int width, int height, float z_near, float z_far)
FlTexture * texture
double y
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:179
bool SupportsNormalOffscreenMSAA(const impeller::Context &context)
Definition context.cc:18
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:225
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:365
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:346
constexpr impeller::WindingOrder ToImpellerWindingOrder(FlutterGPUWindingOrder value)
Definition formats.h:530
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:439
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:247
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:270
constexpr impeller::PolygonMode ToImpellerPolygonMode(FlutterGPUPolygonMode value)
Definition formats.h:549
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:387
constexpr impeller::StencilOperation ToImpellerStencilOperation(FlutterGPUStencilOperation value)
Definition formats.h:477
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:408
constexpr impeller::CullMode ToImpellerCullMode(FlutterGPUCullMode value)
Definition formats.h:510
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:327
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98
internal::CopyableLambda< T > MakeCopyable(T lambda)
@ kNone
Does not use the index buffer.
constexpr bool IsDepthWritable(PixelFormat format)
Definition formats.h:119
constexpr bool IsStencilWritable(PixelFormat format)
Definition formats.h:129
Dart_Handle ToDart(const T &object)
std::string StdStringFromDart(Dart_Handle handle)
int32_t height
int32_t width
impeller::SampledImageSlot slot
Definition shader.h:38
impeller::ShaderMetadata metadata
Definition shader.h:39
impeller::ShaderMetadata metadata
Definition shader.h:30
impeller::ShaderUniformSlot slot
Definition shader.h:29
std::shared_ptr< Texture > resolve_texture
Definition formats.h:658
LoadAction load_action
Definition formats.h:659
std::shared_ptr< Texture > texture
Definition formats.h:657
StoreAction store_action
Definition formats.h:660
Describe the color attachment that will be used with this pipeline.
Definition formats.h:518
SamplerAddressMode width_address_mode
SamplerAddressMode height_address_mode
static constexpr TRect MakeXYWH(Type x, Type y, Type width, Type height)
Definition rect.h:136
combines the texture, sampler and sampler slot information.
Definition command.h:59
SampledImageSlot slot
Definition command.h:60