| Flutter Impeller |

pipeline_library_mtl.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_BACKEND_METAL_PIPELINE_LIBRARY_MTL_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_LIBRARY_MTL_H_
7
8 #include <Metal/Metal.h>
9
10 #include "flutter/fml/macros.h"
11 #include "impeller/renderer/pipeline_library.h"
12
13 namespace impeller {
14
15 class ContextMTL;
16
17 class PipelineLibraryMTL final : public PipelineLibrary {
18 public:
19 PipelineLibraryMTL();
20
21 // |PipelineLibrary|
22 ~PipelineLibraryMTL() override;
23
24 private:
25 friend ContextMTL;
26
27 id<MTLDevice> device_ = nullptr;
28 PipelineMap pipelines_;
29 ComputePipelineMap compute_pipelines_;
30
31 explicit PipelineLibraryMTL(id<MTLDevice> device);
32
33 // |PipelineLibrary|
34 bool IsValid() const override;
35
36 // |PipelineLibrary|
37 PipelineFuture<PipelineDescriptor> GetPipeline(
38 PipelineDescriptor descriptor) override;
39
40 // |PipelineLibrary|
41 PipelineFuture<ComputePipelineDescriptor> GetPipeline(
42 ComputePipelineDescriptor descriptor) override;
43
44 // |PipelineLibrary|
45 void RemovePipelinesWithEntryPoint(
46 std::shared_ptr<const ShaderFunction> function) override;
47
48 PipelineLibraryMTL(const PipelineLibraryMTL&) = delete;
49
50 PipelineLibraryMTL& operator=(const PipelineLibraryMTL&) = delete;
51 };
52
53 } // namespace impeller
54
55 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_PIPELINE_LIBRARY_MTL_H_
impeller::PipelineDescriptor
Definition: pipeline_descriptor.h:29
impeller::ComputePipelineDescriptor
Definition: compute_pipeline_descriptor.h:30
impeller::PipelineFuture
Definition: pipeline.h:24
impeller::PipelineLibrary
Definition: pipeline_library.h:30
impeller::PipelineMap
std::unordered_map< PipelineDescriptor, PipelineFuture< PipelineDescriptor >, ComparableHash< PipelineDescriptor >, ComparableEqual< PipelineDescriptor > > PipelineMap
Definition: pipeline_library.h:22
pipeline_library.h
impeller::PipelineLibraryMTL::PipelineLibraryMTL
PipelineLibraryMTL()
impeller::ComputePipelineMap
std::unordered_map< ComputePipelineDescriptor, PipelineFuture< ComputePipelineDescriptor >, ComparableHash< ComputePipelineDescriptor >, ComparableEqual< ComputePipelineDescriptor > > ComputePipelineMap
Definition: pipeline_library.h:28
impeller::PipelineLibraryMTL::~PipelineLibraryMTL
~PipelineLibraryMTL() override
impeller::PipelineLibraryMTL
Definition: pipeline_library_mtl.h:17
impeller::ContextMTL
Definition: context_mtl.h:34
impeller
Definition: aiks_context.cc:10