Flutter Engine
The Flutter Engine
compute_pipeline_descriptor.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
11
12namespace impeller {
13
15
17
18// Comparable<ComputePipelineDescriptor>
20 auto seed = fml::HashCombine();
21 fml::HashCombineSeed(seed, label_);
22 if (entrypoint_) {
23 fml::HashCombineSeed(seed, entrypoint_->GetHash());
24 }
25 return seed;
26}
27
28// Comparable<ComputePipelineDescriptor>
30 const ComputePipelineDescriptor& other) const {
31 return label_ == other.label_ &&
32 DeepComparePointer(entrypoint_, other.entrypoint_);
33}
34
36 std::string label) {
37 label_ = std::move(label);
38 return *this;
39}
40
42 std::shared_ptr<const ShaderFunction> function) {
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}
56
57std::shared_ptr<const ShaderFunction>
59 return entrypoint_;
60}
61
62const std::string& ComputePipelineDescriptor::GetLabel() const {
63 return label_;
64}
65
67 const DescriptorSetLayout desc_set_layout[],
68 size_t count) {
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}
75
76const std::vector<DescriptorSetLayout>&
78 return descriptor_set_layouts_;
79}
80
81} // namespace impeller
int count
Definition: FontMgrTest.cpp:50
const std::vector< DescriptorSetLayout > & GetDescriptorSetLayouts() const
std::shared_ptr< const ShaderFunction > GetStageEntrypoint() const
bool IsEqual(const ComputePipelineDescriptor &other) const override
ComputePipelineDescriptor & SetLabel(std::string label)
ComputePipelineDescriptor & SetStageEntrypoint(std::shared_ptr< const ShaderFunction > function)
bool RegisterDescriptorSetLayouts(const std::array< DescriptorSetLayout, Size > &inputs)
#define FML_DCHECK(condition)
Definition: logging.h:103
Dart_NativeFunction function
Definition: fuchsia.cc:51
constexpr std::size_t HashCombine()
Definition: hash_combine.h:25
constexpr void HashCombineSeed(std::size_t &seed, Type arg)
Definition: hash_combine.h:13
bool DeepComparePointer(const std::shared_ptr< ComparableType > &lhs, const std::shared_ptr< ComparableType > &rhs)
Definition: comparable.h:57