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