Flutter Impeller
compute_pipeline_descriptor.h
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 
5 #ifndef FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_DESCRIPTOR_H_
6 #define FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_DESCRIPTOR_H_
7 
8 #include <memory>
9 #include <string>
10 
13 
14 namespace impeller {
15 
16 class ShaderFunction;
17 template <typename T>
18 class Pipeline;
19 
21  : public Comparable<ComputePipelineDescriptor> {
22  public:
24 
26 
27  ComputePipelineDescriptor& SetLabel(std::string_view label);
28 
29  const std::string& GetLabel() const;
30 
32  std::shared_ptr<const ShaderFunction> function);
33 
34  std::shared_ptr<const ShaderFunction> GetStageEntrypoint() const;
35 
36  // Comparable<ComputePipelineDescriptor>
37  std::size_t GetHash() const override;
38 
39  // Comparable<PipelineDescriptor>
40  bool IsEqual(const ComputePipelineDescriptor& other) const override;
41 
42  template <size_t Size>
44  const std::array<DescriptorSetLayout, Size>& inputs) {
45  return RegisterDescriptorSetLayouts(inputs.data(), inputs.size());
46  }
47 
48  bool RegisterDescriptorSetLayouts(const DescriptorSetLayout desc_set_layout[],
49  size_t count);
50 
51  const std::vector<DescriptorSetLayout>& GetDescriptorSetLayouts() const;
52 
53  private:
54  std::string label_;
55  std::shared_ptr<const ShaderFunction> entrypoint_;
56  std::vector<DescriptorSetLayout> descriptor_set_layouts_;
57 };
58 
59 } // namespace impeller
60 
61 #endif // FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_DESCRIPTOR_H_
const std::vector< DescriptorSetLayout > & GetDescriptorSetLayouts() const
ComputePipelineDescriptor & SetLabel(std::string_view label)
std::shared_ptr< const ShaderFunction > GetStageEntrypoint() const
bool IsEqual(const ComputePipelineDescriptor &other) const override
ComputePipelineDescriptor & SetStageEntrypoint(std::shared_ptr< const ShaderFunction > function)
bool RegisterDescriptorSetLayouts(const std::array< DescriptorSetLayout, Size > &inputs)