Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
render_pass.h File Reference
#include <array>
#include <cstdint>
#include <map>
#include <memory>
#include "flutter/lib/gpu/command_buffer.h"
#include "flutter/lib/gpu/export.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "fml/memory/ref_ptr.h"
#include "impeller/core/formats.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/command.h"
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/render_target.h"
#include "lib/gpu/device_buffer.h"
#include "lib/gpu/render_pipeline.h"
#include "lib/gpu/texture.h"

Go to the source code of this file.

Classes

class  flutter::gpu::RenderPass
 
struct  flutter::gpu::RenderPass::BufferAndUniformSlot
 

Namespaces

namespace  flutter
 
namespace  flutter::gpu
 

Functions

FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_Initialize (Dart_Handle wrapper)
 
FLUTTER_GPU_EXPORT 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)
 
FLUTTER_GPU_EXPORT 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)
 
FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_RenderPass_Begin (flutter::gpu::RenderPass *wrapper, flutter::gpu::CommandBuffer *command_buffer)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_BindPipeline (flutter::gpu::RenderPass *wrapper, flutter::gpu::RenderPipeline *pipeline)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_BindVertexBufferDevice (flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int slot)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_BindIndexBufferDevice (flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int index_type)
 
FLUTTER_GPU_EXPORT 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)
 
FLUTTER_GPU_EXPORT 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)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_ClearBindings (flutter::gpu::RenderPass *wrapper)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetColorBlendEnable (flutter::gpu::RenderPass *wrapper, int color_attachment_index, bool enable)
 
FLUTTER_GPU_EXPORT 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)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetDepthWriteEnable (flutter::gpu::RenderPass *wrapper, bool enable)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetDepthCompareOperation (flutter::gpu::RenderPass *wrapper, int compare_operation)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetStencilReference (flutter::gpu::RenderPass *wrapper, int stencil_reference)
 
FLUTTER_GPU_EXPORT 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)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetScissor (flutter::gpu::RenderPass *wrapper, int x, int y, int width, int height)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetViewport (flutter::gpu::RenderPass *wrapper, int x, int y, int width, int height, float z_near, float z_far)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetCullMode (flutter::gpu::RenderPass *wrapper, int cull_mode)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetPrimitiveType (flutter::gpu::RenderPass *wrapper, int primitive_type)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetWindingOrder (flutter::gpu::RenderPass *wrapper, int winding_order)
 
FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_SetPolygonMode (flutter::gpu::RenderPass *wrapper, int polygon_mode)
 
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_RenderPass_Draw (flutter::gpu::RenderPass *wrapper, int vertex_count, int instance_count)
 
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_RenderPass_DrawIndexed (flutter::gpu::RenderPass *wrapper, int index_count, int instance_count)
 

Function Documentation

◆ InternalFlutterGpu_RenderPass_Begin()

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

Definition at line 343 of file render_pass.cc.

345 {
346 if (!wrapper->Begin(*command_buffer)) {
347 return tonic::ToDart("Failed to begin RenderPass");
348 }
349 return Dart_Null();
350}
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()

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

Definition at line 397 of file render_pass.cc.

402 {
403 BindIndexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
404 length_in_bytes, index_type);
405}
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()

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

Definition at line 352 of file render_pass.cc.

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

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

◆ InternalFlutterGpu_RenderPass_BindTexture()

FLUTTER_GPU_EXPORT 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 
)
extern

Definition at line 465 of file render_pass.cc.

474 {
475 auto uniform_name = tonic::StdStringFromDart(uniform_name_handle);
476 const flutter::gpu::Shader::TextureBinding* texture_binding =
478 // TODO(bdero): Return an error string stating that no uniform texture with
479 // this name exists and throw an exception.
480 if (!texture_binding) {
481 return false;
482 }
483
484 impeller::SamplerDescriptor sampler_desc;
485 sampler_desc.min_filter = flutter::gpu::ToImpellerMinMagFilter(min_filter);
486 sampler_desc.mag_filter = flutter::gpu::ToImpellerMinMagFilter(mag_filter);
487 sampler_desc.mip_filter = flutter::gpu::ToImpellerMipFilter(mip_filter);
488 sampler_desc.width_address_mode =
490 sampler_desc.height_address_mode =
492 auto sampler =
493 wrapper->GetContext()->GetSamplerLibrary()->GetSampler(sampler_desc);
494
495 flutter::gpu::RenderPass::TextureUniformMap* uniform_map = nullptr;
496 switch (shader->GetShaderStage()) {
498 uniform_map = &wrapper->vertex_texture_bindings;
499 break;
501 uniform_map = &wrapper->fragment_texture_bindings;
502 break;
505 return false;
506 }
507 uniform_map->insert_or_assign(
508 texture_binding,
510 .slot = texture_binding->slot,
511 .texture = {&texture_binding->metadata, texture->GetTexture()},
512 .sampler = sampler,
513 });
514 return true;
515}
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
impeller::ShaderStage GetShaderStage() const
Definition shader.cc:167
const Shader::TextureBinding * GetUniformTexture(const std::string &name) const
Definition shader.cc:185
std::string uniform_name
FlTexture * texture
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:453
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:434
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:415
std::string StdStringFromDart(Dart_Handle handle)
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, 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()

FLUTTER_GPU_EXPORT 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 
)
extern

Definition at line 453 of file render_pass.cc.

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

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

Definition at line 376 of file render_pass.cc.

381 {
382 BindVertexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
383 length_in_bytes, slot);
384}
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()

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

Definition at line 517 of file render_pass.cc.

518 {
519 wrapper->ClearBindings();
520}

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

◆ InternalFlutterGpu_RenderPass_Draw()

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

Definition at line 669 of file render_pass.cc.

671 {
672 // Guard the casts to size_t; a negative value would wrap.
673 return vertex_count >= 0 && instance_count >= 0 &&
674 wrapper->Draw(vertex_count, instance_count, /*indexed=*/false);
675}
bool Draw(size_t element_count, size_t instance_count, bool indexed)

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

◆ InternalFlutterGpu_RenderPass_DrawIndexed()

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

Definition at line 677 of file render_pass.cc.

680 {
681 // Guard the casts to size_t; a negative value would wrap.
682 return index_count >= 0 && instance_count >= 0 &&
683 wrapper->Draw(index_count, instance_count, /*indexed=*/true);
684}

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

◆ InternalFlutterGpu_RenderPass_Initialize()

FLUTTER_GPU_EXPORT void InternalFlutterGpu_RenderPass_Initialize ( Dart_Handle  wrapper)
extern

Exports

Definition at line 262 of file render_pass.cc.

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

◆ InternalFlutterGpu_RenderPass_SetColorAttachment()

FLUTTER_GPU_EXPORT 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 
)
extern

Definition at line 267 of file render_pass.cc.

280 {
284 desc.clear_color = impeller::Color(clear_color_r, clear_color_g,
285 clear_color_b, clear_color_a);
286 desc.texture = texture->GetTexture();
287 desc.mip_level = mip_level;
288 desc.slice = slice;
289 if (!Dart_IsNull(resolve_texture_wrapper)) {
290 flutter::gpu::Texture* resolve_texture =
292 resolve_texture_wrapper);
293 desc.resolve_texture = resolve_texture->GetTexture();
294
295 // If the backend doesn't support normal MSAA, gracefully fallback to
296 // rendering without MSAA.
298 desc.texture = desc.resolve_texture;
299 desc.resolve_texture = nullptr;
301 }
302 }
303 wrapper->GetRenderTarget().SetColorAttachment(desc, color_attachment_index);
304 return Dart_Null();
305}
impeller::RenderTarget & GetRenderTarget()
std::shared_ptr< impeller::Texture > GetTexture()
Definition texture.cc:38
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:335
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:358
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()

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

Definition at line 522 of file render_pass.cc.

525 {
526 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
527 color.blending_enabled = enable;
528}
impeller::ColorAttachmentDescriptor & GetColorAttachmentDescriptor(size_t color_attachment_index)

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

◆ InternalFlutterGpu_RenderPass_SetColorBlendEquation()

FLUTTER_GPU_EXPORT 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 
)
extern

Definition at line 530 of file render_pass.cc.

538 {
539 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
540 color.color_blend_op =
541 flutter::gpu::ToImpellerBlendOperation(color_blend_operation);
542 color.src_color_blend_factor =
543 flutter::gpu::ToImpellerBlendFactor(source_color_blend_factor);
544 color.dst_color_blend_factor =
545 flutter::gpu::ToImpellerBlendFactor(destination_color_blend_factor);
546 color.alpha_blend_op =
547 flutter::gpu::ToImpellerBlendOperation(alpha_blend_operation);
548 color.src_alpha_blend_factor =
549 flutter::gpu::ToImpellerBlendFactor(source_alpha_blend_factor);
550 color.dst_alpha_blend_factor =
551 flutter::gpu::ToImpellerBlendFactor(destination_alpha_blend_factor);
552}
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:267
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:313

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

◆ InternalFlutterGpu_RenderPass_SetCullMode()

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

Definition at line 634 of file render_pass.cc.

636 {
637 impeller::PipelineDescriptor& pipeline_descriptor =
638 wrapper->GetPipelineDescriptor();
639 pipeline_descriptor.SetCullMode(flutter::gpu::ToImpellerCullMode(cull_mode));
640}
impeller::PipelineDescriptor & GetPipelineDescriptor()
constexpr impeller::CullMode ToImpellerCullMode(FlutterGPUCullMode value)
Definition formats.h:598

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

◆ InternalFlutterGpu_RenderPass_SetDepthCompareOperation()

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

Definition at line 561 of file render_pass.cc.

563 {
564 auto& depth = wrapper->GetDepthAttachmentDescriptor();
565 depth.depth_compare =
567}
impeller::DepthAttachmentDescriptor & GetDepthAttachmentDescriptor()
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:527

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

◆ InternalFlutterGpu_RenderPass_SetDepthStencilAttachment()

FLUTTER_GPU_EXPORT 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 
)
extern

Definition at line 307 of file render_pass.cc.

317 {
318 {
320 desc.load_action = flutter::gpu::ToImpellerLoadAction(depth_load_action);
321 desc.store_action = flutter::gpu::ToImpellerStoreAction(depth_store_action);
322 desc.clear_depth = depth_clear_value;
323 desc.texture = texture->GetTexture();
324 desc.mip_level = mip_level;
325 desc.slice = slice;
326 wrapper->GetRenderTarget().SetDepthAttachment(desc);
327 }
328 {
330 desc.load_action = flutter::gpu::ToImpellerLoadAction(stencil_load_action);
331 desc.store_action =
332 flutter::gpu::ToImpellerStoreAction(stencil_store_action);
333 desc.clear_stencil = stencil_clear_value;
334 desc.texture = texture->GetTexture();
335 desc.mip_level = mip_level;
336 desc.slice = slice;
337 wrapper->GetRenderTarget().SetStencilAttachment(desc);
338 }
339
340 return Dart_Null();
341}
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()

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

◆ InternalFlutterGpu_RenderPass_SetPolygonMode()

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

Definition at line 660 of file render_pass.cc.

662 {
663 impeller::PipelineDescriptor& pipeline_descriptor =
664 wrapper->GetPipelineDescriptor();
665 pipeline_descriptor.SetPolygonMode(
667}
void SetPolygonMode(PolygonMode mode)
constexpr impeller::PolygonMode ToImpellerPolygonMode(FlutterGPUPolygonMode value)
Definition formats.h:637

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

◆ InternalFlutterGpu_RenderPass_SetPrimitiveType()

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

Definition at line 642 of file render_pass.cc.

644 {
645 impeller::PipelineDescriptor& pipeline_descriptor =
646 wrapper->GetPipelineDescriptor();
647 pipeline_descriptor.SetPrimitiveType(
649}
void SetPrimitiveType(PrimitiveType type)
constexpr impeller::PrimitiveType ToImpellerPrimitiveType(FlutterGPUPrimitiveType value)
Definition formats.h:496

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

◆ InternalFlutterGpu_RenderPass_SetScissor()

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

Definition at line 575 of file render_pass.cc.

579 {
581}
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()

FLUTTER_GPU_EXPORT 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 
)
extern

Definition at line 604 of file render_pass.cc.

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

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

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

Definition at line 569 of file render_pass.cc.

571 {
572 wrapper->stencil_reference = static_cast<uint32_t>(stencil_reference);
573}

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

◆ InternalFlutterGpu_RenderPass_SetViewport()

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

Definition at line 583 of file render_pass.cc.

590 {
592
593 auto depth_range = impeller::DepthRange();
594 depth_range.z_near = z_near;
595 depth_range.z_far = z_far;
596
597 auto viewport = impeller::Viewport();
598 viewport.rect = rect;
599 viewport.depth_range = depth_range;
600
601 wrapper->viewport = viewport;
602}
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()

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

Definition at line 651 of file render_pass.cc.

653 {
654 impeller::PipelineDescriptor& pipeline_descriptor =
655 wrapper->GetPipelineDescriptor();
656 pipeline_descriptor.SetWindingOrder(
658}
void SetWindingOrder(WindingOrder order)
constexpr impeller::WindingOrder ToImpellerWindingOrder(FlutterGPUWindingOrder value)
Definition formats.h:618

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