Flutter Engine
The Flutter Engine
pipeline_library_vk.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_VULKAN_PIPELINE_LIBRARY_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_LIBRARY_VK_H_
7
8#include <atomic>
9
10#include "flutter/fml/concurrent_message_loop.h"
11#include "flutter/fml/unique_fd.h"
19
20namespace impeller {
21
22class ContextVK;
23
25 : public PipelineLibrary,
26 public BackendCast<PipelineLibraryVK, PipelineLibrary> {
27 public:
28 // |PipelineLibrary|
30
32
33 const std::shared_ptr<PipelineCacheVK>& GetPSOCache() const;
34
35 const std::shared_ptr<fml::ConcurrentTaskRunner>& GetWorkerTaskRunner() const;
36
37 private:
38 friend ContextVK;
39
40 std::weak_ptr<DeviceHolderVK> device_holder_;
41 std::shared_ptr<PipelineCacheVK> pso_cache_;
42 std::shared_ptr<fml::ConcurrentTaskRunner> worker_task_runner_;
43 Mutex pipelines_mutex_;
44 PipelineMap pipelines_ IPLR_GUARDED_BY(pipelines_mutex_);
45 Mutex compute_pipelines_mutex_;
46 ComputePipelineMap compute_pipelines_ IPLR_GUARDED_BY(
47 compute_pipelines_mutex_);
48 std::atomic_size_t frames_acquired_ = 0u;
49 bool is_valid_ = false;
50 bool cache_dirty_ = false;
51
53 const std::shared_ptr<DeviceHolderVK>& device_holder,
54 std::shared_ptr<const Capabilities> caps,
55 fml::UniqueFD cache_directory,
56 std::shared_ptr<fml::ConcurrentTaskRunner> worker_task_runner);
57
58 // |PipelineLibrary|
59 bool IsValid() const override;
60
61 // |PipelineLibrary|
63 bool async) override;
64
65 // |PipelineLibrary|
68 bool async) override;
69
70 // |PipelineLibrary|
71 void RemovePipelinesWithEntryPoint(
72 std::shared_ptr<const ShaderFunction> function) override;
73
74 std::unique_ptr<ComputePipelineVK> CreateComputePipeline(
76
77 void PersistPipelineCacheToDisk();
78
79 PipelineLibraryVK(const PipelineLibraryVK&) = delete;
80
81 PipelineLibraryVK& operator=(const PipelineLibraryVK&) = delete;
82};
83
84} // namespace impeller
85
86#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_PIPELINE_LIBRARY_VK_H_
const std::shared_ptr< fml::ConcurrentTaskRunner > & GetWorkerTaskRunner() const
const std::shared_ptr< PipelineCacheVK > & GetPSOCache() const
Dart_NativeFunction function
Definition: fuchsia.cc:51
std::unordered_map< ComputePipelineDescriptor, PipelineFuture< ComputePipelineDescriptor >, ComparableHash< ComputePipelineDescriptor >, ComparableEqual< ComputePipelineDescriptor > > ComputePipelineMap
std::unordered_map< PipelineDescriptor, PipelineFuture< PipelineDescriptor >, ComparableHash< PipelineDescriptor >, ComparableEqual< PipelineDescriptor > > PipelineMap