| Flutter Impeller |

pipeline_library.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_PIPELINE_LIBRARY_H_
6 #define FLUTTER_IMPELLER_RENDERER_PIPELINE_LIBRARY_H_
7
8 #include <optional>
9
10 #include "compute_pipeline_descriptor.h"
11 #include "flutter/fml/macros.h"
12 #include "impeller/renderer/pipeline.h"
13 #include "impeller/renderer/pipeline_descriptor.h"
14
15 namespace impeller {
16
17 class Context;
18
19 using PipelineMap = std::unordered_map<PipelineDescriptor,
20 PipelineFuture<PipelineDescriptor>,
21 ComparableHash<PipelineDescriptor>,
22 ComparableEqual<PipelineDescriptor>>;
23
24 using ComputePipelineMap =
25 std::unordered_map<ComputePipelineDescriptor,
26 PipelineFuture<ComputePipelineDescriptor>,
27 ComparableHash<ComputePipelineDescriptor>,
28 ComparableEqual<ComputePipelineDescriptor>>;
29
30 class PipelineLibrary : public std::enable_shared_from_this<PipelineLibrary> {
31 public:
32 virtual ~PipelineLibrary();
33
34 PipelineFuture<PipelineDescriptor> GetPipeline(
35 std::optional<PipelineDescriptor> descriptor);
36
37 PipelineFuture<ComputePipelineDescriptor> GetPipeline(
38 std::optional<ComputePipelineDescriptor> descriptor);
39
40 virtual bool IsValid() const = 0;
41
42 virtual PipelineFuture<PipelineDescriptor> GetPipeline(
43 PipelineDescriptor descriptor) = 0;
44
45 virtual PipelineFuture<ComputePipelineDescriptor> GetPipeline(
46 ComputePipelineDescriptor descriptor) = 0;
47
48 virtual void RemovePipelinesWithEntryPoint(
49 std::shared_ptr<const ShaderFunction> function) = 0;
50
51 protected:
52 PipelineLibrary();
53
54 private:
55 PipelineLibrary(const PipelineLibrary&) = delete;
56
57 PipelineLibrary& operator=(const PipelineLibrary&) = delete;
58 };
59
60 } // namespace impeller
61
62 #endif // FLUTTER_IMPELLER_RENDERER_PIPELINE_LIBRARY_H_
impeller::PipelineDescriptor
Definition: pipeline_descriptor.h:24
impeller::ComputePipelineDescriptor
Definition: compute_pipeline_descriptor.h:30
pipeline.h
impeller::PipelineLibrary::IsValid
virtual bool IsValid() const =0
impeller::ComparableHash
Definition: comparable.h:39
impeller::PipelineLibrary::~PipelineLibrary
virtual ~PipelineLibrary()
impeller::PipelineFuture
Definition: pipeline.h:24
impeller::PipelineLibrary::GetPipeline
PipelineFuture< PipelineDescriptor > GetPipeline(std::optional< PipelineDescriptor > descriptor)
Definition: pipeline_library.cc:13
impeller::PipelineLibrary
Definition: pipeline_library.h:30
compute_pipeline_descriptor.h
impeller::PipelineMap
std::unordered_map< PipelineDescriptor, PipelineFuture< PipelineDescriptor >, ComparableHash< PipelineDescriptor >, ComparableEqual< PipelineDescriptor > > PipelineMap
Definition: pipeline_library.h:22
impeller::ComparableEqual
Definition: comparable.h:48
impeller::PipelineLibrary::PipelineLibrary
PipelineLibrary()
impeller::ComputePipelineMap
std::unordered_map< ComputePipelineDescriptor, PipelineFuture< ComputePipelineDescriptor >, ComparableHash< ComputePipelineDescriptor >, ComparableEqual< ComputePipelineDescriptor > > ComputePipelineMap
Definition: pipeline_library.h:28
impeller::PipelineLibrary::RemovePipelinesWithEntryPoint
virtual void RemovePipelinesWithEntryPoint(std::shared_ptr< const ShaderFunction > function)=0
pipeline_descriptor.h
impeller
Definition: aiks_blur_unittests.cc:20