| 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
11 #include "impeller/base/comparable.h"
12 #include "impeller/core/shader_types.h"
13
14 namespace impeller {
15
16 class ShaderFunction;
17 template <typename T>
18 class Pipeline;
19
20 class ComputePipelineDescriptor final
21 : public Comparable<ComputePipelineDescriptor> {
22 public:
23 ComputePipelineDescriptor();
24
25 ~ComputePipelineDescriptor();
26
27 ComputePipelineDescriptor& SetLabel(std::string_view label);
28
29 const std::string& GetLabel() const;
30
31 ComputePipelineDescriptor& SetStageEntrypoint(
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>
43 bool RegisterDescriptorSetLayouts(
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_
impeller::Comparable
Definition: comparable.h:29
impeller::ComputePipelineDescriptor
Definition: compute_pipeline_descriptor.h:21
impeller::ComputePipelineDescriptor::GetDescriptorSetLayouts
const std::vector< DescriptorSetLayout > & GetDescriptorSetLayouts() const
Definition: compute_pipeline_descriptor.cc:77
impeller::ComputePipelineDescriptor::SetLabel
ComputePipelineDescriptor & SetLabel(std::string_view label)
Definition: compute_pipeline_descriptor.cc:35
impeller::ComputePipelineDescriptor::GetStageEntrypoint
std::shared_ptr< const ShaderFunction > GetStageEntrypoint() const
Definition: compute_pipeline_descriptor.cc:58
impeller::ComputePipelineDescriptor::IsEqual
bool IsEqual(const ComputePipelineDescriptor &other) const override
Definition: compute_pipeline_descriptor.cc:29
impeller::ComputePipelineDescriptor::GetHash
std::size_t GetHash() const override
Definition: compute_pipeline_descriptor.cc:19
impeller::ComputePipelineDescriptor::~ComputePipelineDescriptor
~ComputePipelineDescriptor()
impeller::ComputePipelineDescriptor::SetStageEntrypoint
ComputePipelineDescriptor & SetStageEntrypoint(std::shared_ptr< const ShaderFunction > function)
Definition: compute_pipeline_descriptor.cc:41
impeller::ComputePipelineDescriptor::ComputePipelineDescriptor
ComputePipelineDescriptor()
impeller::ComputePipelineDescriptor::GetLabel
const std::string & GetLabel() const
Definition: compute_pipeline_descriptor.cc:62
impeller::ComputePipelineDescriptor::RegisterDescriptorSetLayouts
bool RegisterDescriptorSetLayouts(const std::array< DescriptorSetLayout, Size > &inputs)
Definition: compute_pipeline_descriptor.h:43
comparable.h
impeller
Definition: allocation.cc:12
shader_types.h
impeller::DescriptorSetLayout
Definition: shader_types.h:167