Flutter Impeller
impeller::scene::SceneContextOptions Struct Reference

#include <scene_context.h>

Classes

struct  Equal
 
struct  Hash
 

Public Member Functions

void ApplyToPipelineDescriptor (const Capabilities &capabilities, PipelineDescriptor &desc) const
 

Public Attributes

SampleCount sample_count = SampleCount::kCount1
 
PrimitiveType primitive_type = PrimitiveType::kTriangle
 

Detailed Description

Definition at line 19 of file scene_context.h.

Member Function Documentation

◆ ApplyToPipelineDescriptor()

void impeller::scene::SceneContextOptions::ApplyToPipelineDescriptor ( const Capabilities capabilities,
PipelineDescriptor desc 
) const

Definition at line 16 of file scene_context.cc.

18  {
19  DepthAttachmentDescriptor depth;
20  depth.depth_compare = CompareFunction::kLess;
21  depth.depth_write_enabled = true;
22  desc.SetDepthStencilAttachmentDescriptor(depth);
23  desc.SetDepthPixelFormat(capabilities.GetDefaultDepthStencilFormat());
24 
25  StencilAttachmentDescriptor stencil;
26  stencil.stencil_compare = CompareFunction::kAlways;
27  stencil.depth_stencil_pass = StencilOperation::kKeep;
28  desc.SetStencilAttachmentDescriptors(stencil);
29  desc.SetStencilPixelFormat(capabilities.GetDefaultDepthStencilFormat());
30 
31  desc.SetSampleCount(sample_count);
32  desc.SetPrimitiveType(primitive_type);
33 
34  desc.SetWindingOrder(WindingOrder::kCounterClockwise);
35  desc.SetCullMode(CullMode::kBackFace);
36 }

References impeller::DepthAttachmentDescriptor::depth_compare, impeller::StencilAttachmentDescriptor::depth_stencil_pass, impeller::DepthAttachmentDescriptor::depth_write_enabled, impeller::Capabilities::GetDefaultDepthStencilFormat(), impeller::kAlways, impeller::kBackFace, impeller::kCounterClockwise, impeller::kKeep, impeller::kLess, primitive_type, sample_count, impeller::PipelineDescriptor::SetCullMode(), impeller::PipelineDescriptor::SetDepthPixelFormat(), impeller::PipelineDescriptor::SetDepthStencilAttachmentDescriptor(), impeller::PipelineDescriptor::SetPrimitiveType(), impeller::PipelineDescriptor::SetSampleCount(), impeller::PipelineDescriptor::SetStencilAttachmentDescriptors(), impeller::PipelineDescriptor::SetStencilPixelFormat(), impeller::PipelineDescriptor::SetWindingOrder(), and impeller::StencilAttachmentDescriptor::stencil_compare.

Member Data Documentation

◆ primitive_type

◆ sample_count


The documentation for this struct was generated from the following files:
impeller::scene::SceneContextOptions::sample_count
SampleCount sample_count
Definition: scene_context.h:20
impeller::StencilOperation::kKeep
@ kKeep
Don't modify the current stencil value.
impeller::scene::SceneContextOptions::primitive_type
PrimitiveType primitive_type
Definition: scene_context.h:21
impeller::CullMode::kBackFace
@ kBackFace
impeller::WindingOrder::kCounterClockwise
@ kCounterClockwise
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.
impeller::CompareFunction::kLess
@ kLess
Comparison test passes if new_value < current_value.