forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcompute_pipeline_descriptor.h
68 lines (50 loc) · 1.82 KB
/
compute_pipeline_descriptor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <functional>
#include <future>
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <type_traits>
#include <unordered_map>
#include "flutter/fml/hash_combine.h"
#include "flutter/fml/macros.h"
#include "impeller/base/comparable.h"
#include "impeller/core/formats.h"
#include "impeller/core/shader_types.h"
#include "impeller/tessellator/tessellator.h"
namespace impeller {
class ShaderFunction;
template <typename T>
class Pipeline;
class ComputePipelineDescriptor final
: public Comparable<ComputePipelineDescriptor> {
public:
ComputePipelineDescriptor();
~ComputePipelineDescriptor();
ComputePipelineDescriptor& SetLabel(std::string label);
const std::string& GetLabel() const;
ComputePipelineDescriptor& SetStageEntrypoint(
std::shared_ptr<const ShaderFunction> function);
std::shared_ptr<const ShaderFunction> GetStageEntrypoint() const;
// Comparable<ComputePipelineDescriptor>
std::size_t GetHash() const override;
// Comparable<PipelineDescriptor>
bool IsEqual(const ComputePipelineDescriptor& other) const override;
template <size_t Size>
bool RegisterDescriptorSetLayouts(
const std::array<DescriptorSetLayout, Size>& inputs) {
return RegisterDescriptorSetLayouts(inputs.data(), inputs.size());
}
bool RegisterDescriptorSetLayouts(const DescriptorSetLayout desc_set_layout[],
size_t count);
const std::vector<DescriptorSetLayout>& GetDescriptorSetLayouts() const;
private:
std::string label_;
std::shared_ptr<const ShaderFunction> entrypoint_;
std::vector<DescriptorSetLayout> descriptor_set_layouts_;
};
} // namespace impeller