| 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 <functional>
9 #include <future>
10 #include <map>
11 #include <memory>
12 #include <string>
13 #include <string_view>
14 #include <type_traits>
15 #include <unordered_map>
16
17 #include "flutter/fml/hash_combine.h"
18 #include "flutter/fml/macros.h"
19 #include "impeller/base/comparable.h"
20 #include "impeller/core/formats.h"
21 #include "impeller/core/shader_types.h"
22 #include "impeller/tessellator/tessellator.h"
23
24 namespace impeller {
25
26 class ShaderFunction;
27 template <typename T>
28 class Pipeline;
29
30 class ComputePipelineDescriptor final
31 : public Comparable<ComputePipelineDescriptor> {
32 public:
33 ComputePipelineDescriptor();
34
35 ~ComputePipelineDescriptor();
36
37 ComputePipelineDescriptor& SetLabel(std::string label);
38
39 const std::string& GetLabel() const;
40
41 ComputePipelineDescriptor& SetStageEntrypoint(
42 std::shared_ptr<const ShaderFunction> function);
43
44 std::shared_ptr<const ShaderFunction> GetStageEntrypoint() const;
45
46 // Comparable<ComputePipelineDescriptor>
47 std::size_t GetHash() const override;
48
49 // Comparable<PipelineDescriptor>
50 bool IsEqual(const ComputePipelineDescriptor& other) const override;
51
52 template <size_t Size>
53 bool RegisterDescriptorSetLayouts(
54 const std::array<DescriptorSetLayout, Size>& inputs) {
55 return RegisterDescriptorSetLayouts(inputs.data(), inputs.size());
56 }
57
58 bool RegisterDescriptorSetLayouts(const DescriptorSetLayout desc_set_layout[],
59 size_t count);
60
61 const std::vector<DescriptorSetLayout>& GetDescriptorSetLayouts() const;
62
63 private:
64 std::string label_;
65 std::shared_ptr<const ShaderFunction> entrypoint_;
66 std::vector<DescriptorSetLayout> descriptor_set_layouts_;
67 };
68
69 } // namespace impeller
70
71 #endif // FLUTTER_IMPELLER_RENDERER_COMPUTE_PIPELINE_DESCRIPTOR_H_
impeller::Pipeline
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Definition: compute_pipeline_descriptor.h:28
impeller::ComputePipelineDescriptor
Definition: compute_pipeline_descriptor.h:30
impeller::ComputePipelineDescriptor::GetStageEntrypoint
std::shared_ptr< const ShaderFunction > GetStageEntrypoint() const
Definition: compute_pipeline_descriptor.cc:58
impeller::DescriptorSetLayout
Definition: shader_types.h:162
impeller::ComputePipelineDescriptor::~ComputePipelineDescriptor
~ComputePipelineDescriptor()
impeller::ComputePipelineDescriptor::GetDescriptorSetLayouts
const std::vector< DescriptorSetLayout > & GetDescriptorSetLayouts() const
Definition: compute_pipeline_descriptor.cc:77
impeller::ComputePipelineDescriptor::IsEqual
bool IsEqual(const ComputePipelineDescriptor &other) const override
Definition: compute_pipeline_descriptor.cc:29
formats.h
impeller::ComputePipelineDescriptor::GetHash
std::size_t GetHash() const override
Definition: compute_pipeline_descriptor.cc:19
impeller::ComputePipelineDescriptor::SetStageEntrypoint
ComputePipelineDescriptor & SetStageEntrypoint(std::shared_ptr< const ShaderFunction > function)
Definition: compute_pipeline_descriptor.cc:41
impeller::ComputePipelineDescriptor::RegisterDescriptorSetLayouts
bool RegisterDescriptorSetLayouts(const std::array< DescriptorSetLayout, Size > &inputs)
Definition: compute_pipeline_descriptor.h:53
tessellator.h
impeller::ComputePipelineDescriptor::SetLabel
ComputePipelineDescriptor & SetLabel(std::string label)
Definition: compute_pipeline_descriptor.cc:35
impeller::ComputePipelineDescriptor::ComputePipelineDescriptor
ComputePipelineDescriptor()
impeller::ComputePipelineDescriptor::GetLabel
const std::string & GetLabel() const
Definition: compute_pipeline_descriptor.cc:62
impeller::Comparable
Definition: comparable.h:29
comparable.h
shader_types.h
impeller
Definition: aiks_context.cc:10