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

#include <compute_pipeline_descriptor.h>

Inheritance diagram for impeller::ComputePipelineDescriptor:
impeller::Comparable< ComputePipelineDescriptor > impeller::ComparableBase

Public Member Functions

 ComputePipelineDescriptor ()
 
 ~ComputePipelineDescriptor ()
 
ComputePipelineDescriptorSetLabel (std::string label)
 
const std::string & GetLabel () const
 
ComputePipelineDescriptorSetStageEntrypoint (std::shared_ptr< const ShaderFunction > function)
 
std::shared_ptr< const ShaderFunctionGetStageEntrypoint () 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
 
virtual std::size_t GetHash () const=0
 
virtual bool IsEqual (const ComputePipelineDescriptor &other) const=0
 

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
overridevirtual

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}
constexpr std::size_t HashCombine()
Definition: hash_combine.h:25
constexpr void HashCombineSeed(std::size_t &seed, Type arg)
Definition: hash_combine.h:13

◆ GetLabel()

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

Definition at line 62 of file compute_pipeline_descriptor.cc.

62 {
63 return label_;
64}

◆ 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}

◆ IsEqual()

bool impeller::ComputePipelineDescriptor::IsEqual ( const ComputePipelineDescriptor other) const
overridevirtual

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}
bool DeepComparePointer(const std::shared_ptr< ComparableType > &lhs, const std::shared_ptr< ComparableType > &rhs)
Definition: comparable.h:57

◆ 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}
int count
Definition: FontMgrTest.cpp:50

◆ 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 }
bool RegisterDescriptorSetLayouts(const std::array< DescriptorSetLayout, Size > &inputs)

◆ SetLabel()

ComputePipelineDescriptor & impeller::ComputePipelineDescriptor::SetLabel ( std::string  label)

Definition at line 35 of file compute_pipeline_descriptor.cc.

36 {
37 label_ = std::move(label);
38 return *this;
39}

◆ SetStageEntrypoint()

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

Definition at line 41 of file compute_pipeline_descriptor.cc.

42 {
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}
#define FML_DCHECK(condition)
Definition: logging.h:103
Dart_NativeFunction function
Definition: fuchsia.cc:51

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