| Flutter Impeller |

Public Member Functions | List of all members
impeller::ComputePipelineDescriptor Class Referencefinal

`#include <compute_pipeline_descriptor.h>`

Inheritance diagram for impeller::ComputePipelineDescriptor:

## Public Member Functions
| ComputePipelineDescriptor ()
| ~ComputePipelineDescriptor ()
ComputePipelineDescriptor & | SetLabel (std::string_view label)
const std::string & | GetLabel () const
ComputePipelineDescriptor & | SetStageEntrypoint (std::shared_ptr< const ShaderFunction > function)
std::shared_ptr< const ShaderFunction > | GetStageEntrypoint () const
std::size_t | GetHash () const override
bool | IsEqual (const ComputePipelineDescriptor &other) const override
template<size_t Size>
bool | RegisterDescriptorSetLayouts (const std::array< DescriptorSetLayout, Size > &inputs)
bool | RegisterDescriptorSetLayouts (const DescriptorSetLayout desc_set_layout[], size_t count)
const std::vector< DescriptorSetLayout > & | GetDescriptorSetLayouts () const

## Detailed Description

Definition at line 20 of file compute_pipeline_descriptor.h.

## Constructor & Destructor Documentation

## ◆ ComputePipelineDescriptor()

impeller::ComputePipelineDescriptor::ComputePipelineDescriptor | ( |  | ) |
| default

## ◆ ~ComputePipelineDescriptor()

impeller::ComputePipelineDescriptor::~ComputePipelineDescriptor | ( |  | ) |
| default

## Member Function Documentation

## ◆ GetDescriptorSetLayouts()

const std::vector< DescriptorSetLayout > & impeller::ComputePipelineDescriptor::GetDescriptorSetLayouts | ( |  | ) | const

Definition at line 77 of file compute_pipeline_descriptor.cc.

77 {
78 return descriptor_set_layouts_;
79 }

## ◆ GetHash()

std::size_t impeller::ComputePipelineDescriptor::GetHash | ( |  | ) | const
| override virtual

Implements impeller::Comparable< ComputePipelineDescriptor >.

Definition at line 19 of file compute_pipeline_descriptor.cc.

19 {
20 auto seed = fml::HashCombine();
21 fml::HashCombineSeed(seed, label_);
22 if (entrypoint_) {
23 fml::HashCombineSeed(seed, entrypoint_->GetHash());
24 }
25 return seed;
26 }

## ◆ GetLabel()

const std::string & impeller::ComputePipelineDescriptor::GetLabel | ( |  | ) | const

Definition at line 62 of file compute_pipeline_descriptor.cc.

62 {
63 return label_;
64 }

Referenced by impeller::GetMTLComputePipelineDescriptor().

## ◆ GetStageEntrypoint()

std::shared_ptr< const ShaderFunction > impeller::ComputePipelineDescriptor::GetStageEntrypoint | ( |  | ) | const

Definition at line 58 of file compute_pipeline_descriptor.cc.

58 {
59 return entrypoint_;
60 }

Referenced by impeller::GetMTLComputePipelineDescriptor().

## ◆ IsEqual()

bool impeller::ComputePipelineDescriptor::IsEqual | ( | const ComputePipelineDescriptor & | other | ) | const
| override virtual

Implements impeller::Comparable< ComputePipelineDescriptor >.

Definition at line 29 of file compute_pipeline_descriptor.cc.

30 {
31 return label_ == other.label_ &&
32 DeepComparePointer(entrypoint_, other.entrypoint_);
33 }
impeller::DeepComparePointer
bool DeepComparePointer(const std::shared_ptr< ComparableType > &lhs, const std::shared_ptr< ComparableType > &rhs)
Definition: comparable.h:57

References impeller::DeepComparePointer().

## ◆ RegisterDescriptorSetLayouts() [1/2]

bool impeller::ComputePipelineDescriptor::RegisterDescriptorSetLayouts | ( | const DescriptorSetLayout | desc_set_layout[],
|  | size_t | count
| ) |  |

Definition at line 66 of file compute_pipeline_descriptor.cc.

68 {
69 descriptor_set_layouts_.reserve(descriptor_set_layouts_.size() + count);
70 for (size_t i = 0; i < count; i++) {
71 descriptor_set_layouts_.emplace_back(desc_set_layout[i]);
72 }
73 return true;
74 }

## ◆ RegisterDescriptorSetLayouts() [2/2]

template<size_t Size>

bool impeller::ComputePipelineDescriptor::RegisterDescriptorSetLayouts | ( | const std::array< DescriptorSetLayout, Size > & | inputs | ) |
| inline

Definition at line 43 of file compute_pipeline_descriptor.h.

44 {
45 return RegisterDescriptorSetLayouts(inputs.data(), inputs.size());
46 }
impeller::ComputePipelineDescriptor::RegisterDescriptorSetLayouts
bool RegisterDescriptorSetLayouts(const std::array< DescriptorSetLayout, Size > &inputs)
Definition: compute_pipeline_descriptor.h:43

Referenced by impeller::ComputePipelineBuilder< ComputeShader_ >::InitializePipelineDescriptorDefaults().

## ◆ SetLabel()

ComputePipelineDescriptor & impeller::ComputePipelineDescriptor::SetLabel | ( | std::string_view | label | ) |

Definition at line 35 of file compute_pipeline_descriptor.cc.

36 {
37 label_ = label;
38 return *this;
39 }

Referenced by impeller::ComputePipelineBuilder< ComputeShader_ >::InitializePipelineDescriptorDefaults().

## ◆ SetStageEntrypoint()

ComputePipelineDescriptor & impeller::ComputePipelineDescriptor::SetStageEntrypoint | ( | std::shared_ptr< const ShaderFunction > | function | ) |

Definition at line 41 of file compute_pipeline_descriptor.cc.

42 {
43 FML_DCHECK(!function || function->GetStage() == ShaderStage::kCompute);
44 if (!function || function->GetStage() != ShaderStage::kCompute) {
45 return *this;
46 }
47
48 if (function->GetStage() == ShaderStage::kUnknown) {
49 return *this;
50 }
51
52 entrypoint_ = std::move(function);
53
54 return *this;
55 }
impeller::ShaderStage::kUnknown
@ kUnknown
impeller::ShaderStage::kCompute
@ kCompute

References impeller::kCompute, and impeller::kUnknown.

Referenced by impeller::ComputePipelineBuilder< ComputeShader_ >::InitializePipelineDescriptorDefaults().

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

- impeller/renderer/compute_pipeline_descriptor.h
- impeller/renderer/compute_pipeline_descriptor.cc