| Flutter Impeller |

Classes | Public Member Functions | Public Attributes | List of all members
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 17 of file scene_context.h.

## Member Function Documentation

## ◆ ApplyToPipelineDescriptor()

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

Definition at line 15 of file scene_context.cc.

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

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

PrimitiveType impeller::scene::SceneContextOptions::primitive_type = PrimitiveType::kTriangle

Definition at line 19 of file scene_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::scene::SceneContextOptions::Hash::operator()(), and impeller::scene::SceneContextOptions::Equal::operator()().

## ◆ sample_count

SampleCount impeller::scene::SceneContextOptions::sample_count = SampleCount::kCount1

Definition at line 18 of file scene_context.h.

Referenced by ApplyToPipelineDescriptor(), impeller::scene::Material::GetContextOptions(), impeller::scene::SceneContextOptions::Hash::operator()(), and impeller::scene::SceneContextOptions::Equal::operator()().

The documentation for this struct was generated from the following files:

- impeller/scene/scene_context.h
- impeller/scene/scene_context.cc

impeller::scene::SceneContextOptions::sample_count
SampleCount sample_count
Definition: scene_context.h:18
impeller::scene::SceneContextOptions::primitive_type
PrimitiveType primitive_type
Definition: scene_context.h:19
impeller::StencilOperation::kKeep
@ kKeep
Don't modify the current stencil value.
impeller::CullMode::kBackFace
@ kBackFace
impeller::WindingOrder::kCounterClockwise
@ kCounterClockwise
impeller::CompareFunction::kLess
@ kLess
Comparison test passes if new_value < current_value.
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.