Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
render_pass.cc File Reference

Go to the source code of this file.

Namespaces

namespace  flutter
 
namespace  flutter::gpu
 

Functions

 flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, RenderPass)
 
void InternalFlutterGpu_RenderPass_Initialize (Dart_Handle 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, int mip_level, int slice)
 
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, int mip_level, int slice)
 
Dart_Handle InternalFlutterGpu_RenderPass_Begin (flutter::gpu::RenderPass *wrapper, flutter::gpu::CommandBuffer *command_buffer)
 
void InternalFlutterGpu_RenderPass_BindPipeline (flutter::gpu::RenderPass *wrapper, flutter::gpu::RenderPipeline *pipeline)
 
static void BindVertexBuffer (flutter::gpu::RenderPass *wrapper, const std::shared_ptr< const impeller::DeviceBuffer > &buffer, int offset_in_bytes, int length_in_bytes, int slot)
 
void InternalFlutterGpu_RenderPass_BindVertexBufferDevice (flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int slot)
 
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)
 
void InternalFlutterGpu_RenderPass_BindIndexBufferDevice (flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int index_type)
 
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)
 
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)
 
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, int max_anisotropy)
 
void InternalFlutterGpu_RenderPass_ClearBindings (flutter::gpu::RenderPass *wrapper)
 
void InternalFlutterGpu_RenderPass_SetColorBlendEnable (flutter::gpu::RenderPass *wrapper, int color_attachment_index, bool enable)
 
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_SetDepthWriteEnable (flutter::gpu::RenderPass *wrapper, bool enable)
 
void InternalFlutterGpu_RenderPass_SetDepthCompareOperation (flutter::gpu::RenderPass *wrapper, int compare_operation)
 
void InternalFlutterGpu_RenderPass_SetStencilReference (flutter::gpu::RenderPass *wrapper, int stencil_reference)
 
void InternalFlutterGpu_RenderPass_SetScissor (flutter::gpu::RenderPass *wrapper, int x, int y, int width, int height)
 
void InternalFlutterGpu_RenderPass_SetViewport (flutter::gpu::RenderPass *wrapper, int x, int y, int width, int height, float z_near, float z_far)
 
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_SetCullMode (flutter::gpu::RenderPass *wrapper, int cull_mode)
 
void InternalFlutterGpu_RenderPass_SetPrimitiveType (flutter::gpu::RenderPass *wrapper, int primitive_type)
 
void InternalFlutterGpu_RenderPass_SetWindingOrder (flutter::gpu::RenderPass *wrapper, int winding_order)
 
void InternalFlutterGpu_RenderPass_SetPolygonMode (flutter::gpu::RenderPass *wrapper, int polygon_mode)
 
bool InternalFlutterGpu_RenderPass_Draw (flutter::gpu::RenderPass *wrapper, int vertex_count, int instance_count)
 
bool InternalFlutterGpu_RenderPass_DrawIndexed (flutter::gpu::RenderPass *wrapper, int index_count, int instance_count)
 

Function Documentation

◆ BindIndexBuffer()

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 
)
static

Definition at line 387 of file render_pass.cc.

392 {
394 buffer, impeller::Range(offset_in_bytes, length_in_bytes));
396}
impeller::IndexType index_buffer_type
Definition render_pass.h:92
impeller::BufferView index_buffer
Definition render_pass.h:91
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:487

References flutter::gpu::RenderPass::index_buffer, flutter::gpu::RenderPass::index_buffer_type, and flutter::gpu::ToImpellerIndexType().

Referenced by InternalFlutterGpu_RenderPass_BindIndexBufferDevice().

◆ BindUniform()

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 
)
static

Definition at line 408 of file render_pass.cc.

414 {
415 auto uniform_name = tonic::StdStringFromDart(uniform_name_handle);
416 const flutter::gpu::Shader::UniformBinding* uniform_struct =
418 // TODO(bdero): Return an error string stating that no uniform struct with
419 // this name exists and throw an exception.
420 if (!uniform_struct) {
421 return false;
422 }
423
424 flutter::gpu::RenderPass::BufferUniformMap* uniform_map = nullptr;
425 switch (shader->GetShaderStage()) {
427 uniform_map = &wrapper->vertex_uniform_bindings;
428 break;
430 uniform_map = &wrapper->fragment_uniform_bindings;
431 break;
434 return false;
435 }
436
437 if (!buffer || static_cast<size_t>(offset_in_bytes + length_in_bytes) >
438 buffer->GetDeviceBufferDescriptor().size) {
439 return false;
440 }
441
442 uniform_map->insert_or_assign(
443 uniform_struct,
445 .slot = uniform_struct->slot,
447 &uniform_struct->metadata,
449 buffer, impeller::Range(offset_in_bytes, length_in_bytes)),
450 }});
451 return true;
452}
std::unordered_map< const flutter::gpu::Shader::UniformBinding *, BufferAndUniformSlot > BufferUniformMap
Definition render_pass.h:71
BufferUniformMap fragment_uniform_bindings
Definition render_pass.h:78
BufferUniformMap vertex_uniform_bindings
Definition render_pass.h:76
const Shader::UniformBinding * GetUniformStruct(const std::string &name) const
Definition shader.cc:176
impeller::ShaderStage GetShaderStage() const
Definition shader.cc:167
std::string uniform_name
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
std::string StdStringFromDart(Dart_Handle handle)
impeller::ShaderMetadata metadata
Definition shader.h:30
impeller::ShaderUniformSlot slot
Definition shader.h:29

References flutter::gpu::RenderPass::fragment_uniform_bindings, flutter::gpu::Shader::GetShaderStage(), flutter::gpu::Shader::GetUniformStruct(), impeller::kCompute, impeller::kFragment, impeller::kUnknown, impeller::kVertex, flutter::gpu::Shader::UniformBinding::metadata, flutter::gpu::RenderPass::BufferAndUniformSlot::slot, flutter::gpu::Shader::UniformBinding::slot, tonic::StdStringFromDart(), uniform_name, and flutter::gpu::RenderPass::vertex_uniform_bindings.

Referenced by InternalFlutterGpu_RenderPass_BindUniformDevice().

◆ BindVertexBuffer()

static void BindVertexBuffer ( flutter::gpu::RenderPass wrapper,
const std::shared_ptr< const impeller::DeviceBuffer > &  buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  slot 
)
static

Definition at line 360 of file render_pass.cc.

365 {
366 if (slot < 0 || static_cast<size_t>(slot) >=
368 return;
369 }
370 wrapper->vertex_buffers[slot] = impeller::BufferView(
371 buffer, impeller::Range(offset_in_bytes, length_in_bytes));
372 if (static_cast<size_t>(slot) >= wrapper->vertex_buffer_count) {
373 wrapper->vertex_buffer_count = static_cast<size_t>(slot) + 1;
374 }
375}
static constexpr size_t kMaxVertexBufferSlots
Definition render_pass.h:87
std::array< impeller::BufferView, kMaxVertexBufferSlots > vertex_buffers
Definition render_pass.h:88

References flutter::gpu::RenderPass::kMaxVertexBufferSlots, flutter::gpu::RenderPass::vertex_buffer_count, and flutter::gpu::RenderPass::vertex_buffers.

Referenced by impeller::EncodeCommandsInReactor(), and InternalFlutterGpu_RenderPass_BindVertexBufferDevice().

◆ InternalFlutterGpu_RenderPass_Begin()

Dart_Handle InternalFlutterGpu_RenderPass_Begin ( flutter::gpu::RenderPass wrapper,
flutter::gpu::CommandBuffer command_buffer 
)

Definition at line 344 of file render_pass.cc.

346 {
347 if (!wrapper->Begin(*command_buffer)) {
348 return tonic::ToDart("Failed to begin RenderPass");
349 }
350 return Dart_Null();
351}
bool Begin(flutter::gpu::CommandBuffer &command_buffer)
Dart_Handle ToDart(const T &object)
std::shared_ptr< CommandBuffer > command_buffer

References flutter::gpu::RenderPass::Begin(), command_buffer, and tonic::ToDart().

◆ InternalFlutterGpu_RenderPass_BindIndexBufferDevice()

void InternalFlutterGpu_RenderPass_BindIndexBufferDevice ( flutter::gpu::RenderPass wrapper,
flutter::gpu::DeviceBuffer device_buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  index_type 
)

Definition at line 398 of file render_pass.cc.

403 {
404 BindIndexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
405 length_in_bytes, index_type);
406}
std::shared_ptr< impeller::DeviceBuffer > GetBuffer()
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)

References BindIndexBuffer(), and flutter::gpu::DeviceBuffer::GetBuffer().

◆ InternalFlutterGpu_RenderPass_BindPipeline()

void InternalFlutterGpu_RenderPass_BindPipeline ( flutter::gpu::RenderPass wrapper,
flutter::gpu::RenderPipeline pipeline 
)

Definition at line 353 of file render_pass.cc.

355 {
357 wrapper->SetPipeline(std::move(ref));
358}
void SetPipeline(fml::RefPtr< RenderPipeline > pipeline)
std::shared_ptr< PipelineGLES > pipeline

References pipeline, and flutter::gpu::RenderPass::SetPipeline().

◆ InternalFlutterGpu_RenderPass_BindTexture()

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,
int  max_anisotropy 
)

Definition at line 466 of file render_pass.cc.

476 {
477 auto uniform_name = tonic::StdStringFromDart(uniform_name_handle);
478 const flutter::gpu::Shader::TextureBinding* texture_binding =
480 // TODO(bdero): Return an error string stating that no uniform texture with
481 // this name exists and throw an exception.
482 if (!texture_binding) {
483 return false;
484 }
485
486 impeller::SamplerDescriptor sampler_desc;
487 sampler_desc.min_filter = flutter::gpu::ToImpellerMinMagFilter(min_filter);
488 sampler_desc.mag_filter = flutter::gpu::ToImpellerMinMagFilter(mag_filter);
489 sampler_desc.mip_filter = flutter::gpu::ToImpellerMipFilter(mip_filter);
490 sampler_desc.width_address_mode =
492 sampler_desc.height_address_mode =
494 // Backends clamp this to the device limit reported by
495 // Capabilities::GetMaxSamplerAnisotropy.
496 sampler_desc.max_anisotropy =
497 static_cast<uint8_t>(std::clamp(max_anisotropy, 1, 255));
498 auto sampler =
499 wrapper->GetContext()->GetSamplerLibrary()->GetSampler(sampler_desc);
500
501 flutter::gpu::RenderPass::TextureUniformMap* uniform_map = nullptr;
502 switch (shader->GetShaderStage()) {
504 uniform_map = &wrapper->vertex_texture_bindings;
505 break;
507 uniform_map = &wrapper->fragment_texture_bindings;
508 break;
511 return false;
512 }
513 uniform_map->insert_or_assign(
514 texture_binding,
516 .slot = texture_binding->slot,
517 .texture = {&texture_binding->metadata, texture->GetTexture()},
518 .sampler = sampler,
519 });
520 return true;
521}
std::unordered_map< const flutter::gpu::Shader::TextureBinding *, impeller::TextureAndSampler > TextureUniformMap
Definition render_pass.h:74
TextureUniformMap fragment_texture_bindings
Definition render_pass.h:79
TextureUniformMap vertex_texture_bindings
Definition render_pass.h:77
const std::shared_ptr< const impeller::Context > & GetContext() const
const Shader::TextureBinding * GetUniformTexture(const std::string &name) const
Definition shader.cc:185
FlTexture * texture
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:465
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:446
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:427
impeller::SampledImageSlot slot
Definition shader.h:38
impeller::ShaderMetadata metadata
Definition shader.h:39
SamplerAddressMode width_address_mode
SamplerAddressMode height_address_mode
combines the texture, sampler and sampler slot information.
Definition command.h:59
SampledImageSlot slot
Definition command.h:60

References flutter::gpu::RenderPass::fragment_texture_bindings, flutter::gpu::RenderPass::GetContext(), flutter::gpu::Shader::GetShaderStage(), flutter::gpu::Shader::GetUniformTexture(), impeller::SamplerDescriptor::height_address_mode, impeller::kCompute, impeller::kFragment, impeller::kUnknown, impeller::kVertex, impeller::SamplerDescriptor::mag_filter, impeller::SamplerDescriptor::max_anisotropy, flutter::gpu::Shader::TextureBinding::metadata, impeller::SamplerDescriptor::min_filter, impeller::SamplerDescriptor::mip_filter, impeller::TextureAndSampler::slot, flutter::gpu::Shader::TextureBinding::slot, tonic::StdStringFromDart(), texture, flutter::gpu::ToImpellerMinMagFilter(), flutter::gpu::ToImpellerMipFilter(), flutter::gpu::ToImpellerSamplerAddressMode(), uniform_name, flutter::gpu::RenderPass::vertex_texture_bindings, and impeller::SamplerDescriptor::width_address_mode.

◆ InternalFlutterGpu_RenderPass_BindUniformDevice()

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 
)

Definition at line 454 of file render_pass.cc.

460 {
461 return BindUniform(wrapper, shader, uniform_name_handle,
462 device_buffer->GetBuffer(), offset_in_bytes,
463 length_in_bytes);
464}
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)

References BindUniform(), and flutter::gpu::DeviceBuffer::GetBuffer().

◆ InternalFlutterGpu_RenderPass_BindVertexBufferDevice()

void InternalFlutterGpu_RenderPass_BindVertexBufferDevice ( flutter::gpu::RenderPass wrapper,
flutter::gpu::DeviceBuffer device_buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  slot 
)

Definition at line 377 of file render_pass.cc.

382 {
383 BindVertexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
384 length_in_bytes, slot);
385}
static void BindVertexBuffer(flutter::gpu::RenderPass *wrapper, const std::shared_ptr< const impeller::DeviceBuffer > &buffer, int offset_in_bytes, int length_in_bytes, int slot)

References BindVertexBuffer(), and flutter::gpu::DeviceBuffer::GetBuffer().

◆ InternalFlutterGpu_RenderPass_ClearBindings()

void InternalFlutterGpu_RenderPass_ClearBindings ( flutter::gpu::RenderPass wrapper)

Definition at line 523 of file render_pass.cc.

524 {
525 wrapper->ClearBindings();
526}

References flutter::gpu::RenderPass::ClearBindings().

◆ InternalFlutterGpu_RenderPass_Draw()

bool InternalFlutterGpu_RenderPass_Draw ( flutter::gpu::RenderPass wrapper,
int  vertex_count,
int  instance_count 
)

Definition at line 675 of file render_pass.cc.

677 {
678 // Guard the casts to size_t; a negative value would wrap.
679 return vertex_count >= 0 && instance_count >= 0 &&
680 wrapper->Draw(vertex_count, instance_count, /*indexed=*/false);
681}
bool Draw(size_t element_count, size_t instance_count, bool indexed)

References flutter::gpu::RenderPass::Draw().

◆ InternalFlutterGpu_RenderPass_DrawIndexed()

bool InternalFlutterGpu_RenderPass_DrawIndexed ( flutter::gpu::RenderPass wrapper,
int  index_count,
int  instance_count 
)

Definition at line 683 of file render_pass.cc.

686 {
687 // Guard the casts to size_t; a negative value would wrap.
688 return index_count >= 0 && instance_count >= 0 &&
689 wrapper->Draw(index_count, instance_count, /*indexed=*/true);
690}

References flutter::gpu::RenderPass::Draw().

◆ InternalFlutterGpu_RenderPass_Initialize()

void InternalFlutterGpu_RenderPass_Initialize ( Dart_Handle  wrapper)

Exports

Definition at line 263 of file render_pass.cc.

263 {
264 auto res = fml::MakeRefCounted<flutter::gpu::RenderPass>();
265 res->AssociateWithDartWrapper(wrapper);
266}

◆ InternalFlutterGpu_RenderPass_SetColorAttachment()

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,
int  mip_level,
int  slice 
)

Definition at line 268 of file render_pass.cc.

281 {
285 desc.clear_color = impeller::Color(clear_color_r, clear_color_g,
286 clear_color_b, clear_color_a);
287 desc.texture = texture->GetTexture();
288 desc.mip_level = mip_level;
289 desc.slice = slice;
290 if (!Dart_IsNull(resolve_texture_wrapper)) {
291 flutter::gpu::Texture* resolve_texture =
293 resolve_texture_wrapper);
294 desc.resolve_texture = resolve_texture->GetTexture();
295
296 // If the backend doesn't support normal MSAA, gracefully fallback to
297 // rendering without MSAA.
299 desc.texture = desc.resolve_texture;
300 desc.resolve_texture = nullptr;
302 }
303 }
304 wrapper->GetRenderTarget().SetColorAttachment(desc, color_attachment_index);
305 return Dart_Null();
306}
impeller::RenderTarget & GetRenderTarget()
std::shared_ptr< impeller::Texture > GetTexture()
Definition texture.cc:43
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
bool SupportsNormalOffscreenMSAA(const impeller::Context &context)
Definition context.cc:21
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:347
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:370
std::shared_ptr< ContextGLES > context
std::shared_ptr< Texture > resolve_texture
Definition formats.h:910
LoadAction load_action
Definition formats.h:911
std::shared_ptr< Texture > texture
Definition formats.h:909
StoreAction store_action
Definition formats.h:912

References impeller::ColorAttachment::clear_color, context, flutter::gpu::RenderPass::GetRenderTarget(), flutter::gpu::Texture::GetTexture(), impeller::kStore, impeller::Attachment::load_action, impeller::Attachment::mip_level, impeller::Attachment::resolve_texture, impeller::RenderTarget::SetColorAttachment(), impeller::Attachment::slice, impeller::Attachment::store_action, flutter::gpu::SupportsNormalOffscreenMSAA(), impeller::Attachment::texture, texture, flutter::gpu::ToImpellerLoadAction(), and flutter::gpu::ToImpellerStoreAction().

◆ InternalFlutterGpu_RenderPass_SetColorBlendEnable()

void InternalFlutterGpu_RenderPass_SetColorBlendEnable ( flutter::gpu::RenderPass wrapper,
int  color_attachment_index,
bool  enable 
)

Definition at line 528 of file render_pass.cc.

531 {
532 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
533 color.blending_enabled = enable;
534}
impeller::ColorAttachmentDescriptor & GetColorAttachmentDescriptor(size_t color_attachment_index)

References impeller::ColorAttachmentDescriptor::blending_enabled, and flutter::gpu::RenderPass::GetColorAttachmentDescriptor().

◆ InternalFlutterGpu_RenderPass_SetColorBlendEquation()

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 
)

Definition at line 536 of file render_pass.cc.

544 {
545 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
546 color.color_blend_op =
547 flutter::gpu::ToImpellerBlendOperation(color_blend_operation);
548 color.src_color_blend_factor =
549 flutter::gpu::ToImpellerBlendFactor(source_color_blend_factor);
550 color.dst_color_blend_factor =
551 flutter::gpu::ToImpellerBlendFactor(destination_color_blend_factor);
552 color.alpha_blend_op =
553 flutter::gpu::ToImpellerBlendOperation(alpha_blend_operation);
554 color.src_alpha_blend_factor =
555 flutter::gpu::ToImpellerBlendFactor(source_alpha_blend_factor);
556 color.dst_alpha_blend_factor =
557 flutter::gpu::ToImpellerBlendFactor(destination_alpha_blend_factor);
558}
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:279
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:325

References impeller::ColorAttachmentDescriptor::color_blend_op, flutter::gpu::RenderPass::GetColorAttachmentDescriptor(), flutter::gpu::ToImpellerBlendFactor(), and flutter::gpu::ToImpellerBlendOperation().

◆ InternalFlutterGpu_RenderPass_SetCullMode()

void InternalFlutterGpu_RenderPass_SetCullMode ( flutter::gpu::RenderPass wrapper,
int  cull_mode 
)

Definition at line 640 of file render_pass.cc.

642 {
643 impeller::PipelineDescriptor& pipeline_descriptor =
644 wrapper->GetPipelineDescriptor();
645 pipeline_descriptor.SetCullMode(flutter::gpu::ToImpellerCullMode(cull_mode));
646}
impeller::PipelineDescriptor & GetPipelineDescriptor()
constexpr impeller::CullMode ToImpellerCullMode(FlutterGPUCullMode value)
Definition formats.h:610

References flutter::gpu::RenderPass::GetPipelineDescriptor(), impeller::PipelineDescriptor::SetCullMode(), and flutter::gpu::ToImpellerCullMode().

◆ InternalFlutterGpu_RenderPass_SetDepthCompareOperation()

void InternalFlutterGpu_RenderPass_SetDepthCompareOperation ( flutter::gpu::RenderPass wrapper,
int  compare_operation 
)

Definition at line 567 of file render_pass.cc.

569 {
570 auto& depth = wrapper->GetDepthAttachmentDescriptor();
571 depth.depth_compare =
573}
impeller::DepthAttachmentDescriptor & GetDepthAttachmentDescriptor()
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:539

References impeller::DepthAttachmentDescriptor::depth_compare, flutter::gpu::RenderPass::GetDepthAttachmentDescriptor(), and flutter::gpu::ToImpellerCompareFunction().

◆ InternalFlutterGpu_RenderPass_SetDepthStencilAttachment()

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,
int  mip_level,
int  slice 
)

Definition at line 308 of file render_pass.cc.

318 {
319 {
321 desc.load_action = flutter::gpu::ToImpellerLoadAction(depth_load_action);
322 desc.store_action = flutter::gpu::ToImpellerStoreAction(depth_store_action);
323 desc.clear_depth = depth_clear_value;
324 desc.texture = texture->GetTexture();
325 desc.mip_level = mip_level;
326 desc.slice = slice;
327 wrapper->GetRenderTarget().SetDepthAttachment(desc);
328 }
329 {
331 desc.load_action = flutter::gpu::ToImpellerLoadAction(stencil_load_action);
332 desc.store_action =
333 flutter::gpu::ToImpellerStoreAction(stencil_store_action);
334 desc.clear_stencil = stencil_clear_value;
335 desc.texture = texture->GetTexture();
336 desc.mip_level = mip_level;
337 desc.slice = slice;
338 wrapper->GetRenderTarget().SetStencilAttachment(desc);
339 }
340
341 return Dart_Null();
342}
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)

References impeller::DepthAttachment::clear_depth, impeller::StencilAttachment::clear_stencil, flutter::gpu::RenderPass::GetRenderTarget(), impeller::Attachment::load_action, impeller::Attachment::mip_level, impeller::RenderTarget::SetDepthAttachment(), impeller::RenderTarget::SetStencilAttachment(), impeller::Attachment::slice, impeller::Attachment::store_action, impeller::Attachment::texture, texture, flutter::gpu::ToImpellerLoadAction(), and flutter::gpu::ToImpellerStoreAction().

◆ InternalFlutterGpu_RenderPass_SetDepthWriteEnable()

void InternalFlutterGpu_RenderPass_SetDepthWriteEnable ( flutter::gpu::RenderPass wrapper,
bool  enable 
)

◆ InternalFlutterGpu_RenderPass_SetPolygonMode()

void InternalFlutterGpu_RenderPass_SetPolygonMode ( flutter::gpu::RenderPass wrapper,
int  polygon_mode 
)

Definition at line 666 of file render_pass.cc.

668 {
669 impeller::PipelineDescriptor& pipeline_descriptor =
670 wrapper->GetPipelineDescriptor();
671 pipeline_descriptor.SetPolygonMode(
673}
void SetPolygonMode(PolygonMode mode)
constexpr impeller::PolygonMode ToImpellerPolygonMode(FlutterGPUPolygonMode value)
Definition formats.h:649

References flutter::gpu::RenderPass::GetPipelineDescriptor(), impeller::PipelineDescriptor::SetPolygonMode(), and flutter::gpu::ToImpellerPolygonMode().

◆ InternalFlutterGpu_RenderPass_SetPrimitiveType()

void InternalFlutterGpu_RenderPass_SetPrimitiveType ( flutter::gpu::RenderPass wrapper,
int  primitive_type 
)

Definition at line 648 of file render_pass.cc.

650 {
651 impeller::PipelineDescriptor& pipeline_descriptor =
652 wrapper->GetPipelineDescriptor();
653 pipeline_descriptor.SetPrimitiveType(
655}
void SetPrimitiveType(PrimitiveType type)
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:508

References flutter::gpu::RenderPass::GetPipelineDescriptor(), impeller::PipelineDescriptor::SetPrimitiveType(), and flutter::gpu::ToImpellerPrimitiveType().

◆ InternalFlutterGpu_RenderPass_SetScissor()

void InternalFlutterGpu_RenderPass_SetScissor ( flutter::gpu::RenderPass wrapper,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 581 of file render_pass.cc.

585 {
587}
std::optional< impeller::IRect32 > scissor
Definition render_pass.h:95
int32_t x
double y
int32_t height
int32_t width
static constexpr TRect MakeXYWH(Type x, Type y, Type width, Type height)
Definition rect.h:136

References height, impeller::TRect< T >::MakeXYWH(), flutter::gpu::RenderPass::scissor, width, x, and y.

◆ InternalFlutterGpu_RenderPass_SetStencilConfig()

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 
)

Definition at line 610 of file render_pass.cc.

618 {
620 desc.stencil_compare =
621 flutter::gpu::ToImpellerCompareFunction(stencil_compare_operation);
622 desc.stencil_failure =
623 flutter::gpu::ToImpellerStencilOperation(stencil_fail_operation);
624 desc.depth_failure =
625 flutter::gpu::ToImpellerStencilOperation(depth_fail_operation);
626 desc.depth_stencil_pass =
627 flutter::gpu::ToImpellerStencilOperation(depth_stencil_pass_operation);
628 desc.read_mask = static_cast<uint32_t>(read_mask);
629 desc.write_mask = static_cast<uint32_t>(write_mask);
630
631 // Corresponds to the `StencilFace` enum in `gpu/lib/src/render_pass.dart`.
632 if (target_face != 2 /* both or front */) {
633 wrapper->GetStencilFrontAttachmentDescriptor() = desc;
634 }
635 if (target_face != 1 /* both or back */) {
636 wrapper->GetStencilBackAttachmentDescriptor() = desc;
637 }
638}
impeller::StencilAttachmentDescriptor & GetStencilBackAttachmentDescriptor()
impeller::StencilAttachmentDescriptor & GetStencilFrontAttachmentDescriptor()
constexpr impeller::StencilOperation ToImpellerStencilOperation(FlutterGPUStencilOperation value)
Definition formats.h:577

References impeller::StencilAttachmentDescriptor::depth_failure, impeller::StencilAttachmentDescriptor::depth_stencil_pass, flutter::gpu::RenderPass::GetStencilBackAttachmentDescriptor(), flutter::gpu::RenderPass::GetStencilFrontAttachmentDescriptor(), impeller::StencilAttachmentDescriptor::read_mask, impeller::StencilAttachmentDescriptor::stencil_compare, impeller::StencilAttachmentDescriptor::stencil_failure, flutter::gpu::ToImpellerCompareFunction(), flutter::gpu::ToImpellerStencilOperation(), and impeller::StencilAttachmentDescriptor::write_mask.

◆ InternalFlutterGpu_RenderPass_SetStencilReference()

void InternalFlutterGpu_RenderPass_SetStencilReference ( flutter::gpu::RenderPass wrapper,
int  stencil_reference 
)

Definition at line 575 of file render_pass.cc.

577 {
578 wrapper->stencil_reference = static_cast<uint32_t>(stencil_reference);
579}

References flutter::gpu::RenderPass::stencil_reference.

◆ InternalFlutterGpu_RenderPass_SetViewport()

void InternalFlutterGpu_RenderPass_SetViewport ( flutter::gpu::RenderPass wrapper,
int  x,
int  y,
int  width,
int  height,
float  z_near,
float  z_far 
)

Definition at line 589 of file render_pass.cc.

596 {
598
599 auto depth_range = impeller::DepthRange();
600 depth_range.z_near = z_near;
601 depth_range.z_far = z_far;
602
603 auto viewport = impeller::Viewport();
604 viewport.rect = rect;
605 viewport.depth_range = depth_range;
606
607 wrapper->viewport = viewport;
608}
std::optional< impeller::Viewport > viewport
Definition render_pass.h:96

References height, impeller::TRect< T >::MakeXYWH(), flutter::gpu::RenderPass::viewport, width, x, and y.

◆ InternalFlutterGpu_RenderPass_SetWindingOrder()

void InternalFlutterGpu_RenderPass_SetWindingOrder ( flutter::gpu::RenderPass wrapper,
int  winding_order 
)

Definition at line 657 of file render_pass.cc.

659 {
660 impeller::PipelineDescriptor& pipeline_descriptor =
661 wrapper->GetPipelineDescriptor();
662 pipeline_descriptor.SetWindingOrder(
664}
void SetWindingOrder(WindingOrder order)
constexpr impeller::WindingOrder ToImpellerWindingOrder(FlutterGPUWindingOrder value)
Definition formats.h:630

References flutter::gpu::RenderPass::GetPipelineDescriptor(), impeller::PipelineDescriptor::SetWindingOrder(), and flutter::gpu::ToImpellerWindingOrder().