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