| Flutter Impeller |

pipeline_cache_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 #pragma once
6
7 #include "flutter/fml/file.h"
8 #include "flutter/fml/macros.h"
9 #include "impeller/renderer/backend/vulkan/capabilities_vk.h"
10 #include "impeller/renderer/backend/vulkan/device_holder.h"
11
12 namespace impeller {
13
14 class PipelineCacheVK {
15 public:
16 // The [device] is passed in directly so that it can be used in the
17 // constructor directly. The [device_holder] isn't guaranteed to be valid
18 // at the time of executing `PipelineCacheVK` because of how `ContextVK` does
19 // initialization.
20 explicit PipelineCacheVK(std::shared_ptr<const Capabilities> caps,
21 std::shared_ptr<DeviceHolder> device_holder,
22 fml::UniqueFD cache_directory);
23
24 ~PipelineCacheVK();
25
26 bool IsValid() const;
27
28 vk::UniquePipeline CreatePipeline(const vk::GraphicsPipelineCreateInfo& info);
29
30 vk::UniquePipeline CreatePipeline(const vk::ComputePipelineCreateInfo& info);
31
32 const CapabilitiesVK* GetCapabilities() const;
33
34 void PersistCacheToDisk() const;
35
36 private:
37 const std::shared_ptr<const Capabilities> caps_;
38 std::weak_ptr<DeviceHolder> device_holder_;
39 const fml::UniqueFD cache_directory_;
40 vk::UniquePipelineCache cache_;
41 bool is_valid_ = false;
42
43 std::shared_ptr<fml::Mapping> CopyPipelineCacheData() const;
44
45 FML_DISALLOW_COPY_AND_ASSIGN(PipelineCacheVK);
46 };
47
48 } // namespace impeller
impeller::PipelineCacheVK::PipelineCacheVK
PipelineCacheVK(std::shared_ptr< const Capabilities > caps, std::shared_ptr< DeviceHolder > device_holder, fml::UniqueFD cache_directory)
Definition: pipeline_cache_vk.cc:56
impeller::PipelineCacheVK::GetCapabilities
const CapabilitiesVK * GetCapabilities() const
Definition: pipeline_cache_vk.cc:190
device_holder.h
impeller::PipelineCacheVK::PersistCacheToDisk
void PersistCacheToDisk() const
Definition: pipeline_cache_vk.cc:169
impeller::PipelineCacheVK
Definition: pipeline_cache_vk.h:14
capabilities_vk.h
impeller::PipelineCacheVK::~PipelineCacheVK
~PipelineCacheVK()
Definition: pipeline_cache_vk.cc:103
impeller::CapabilitiesVK
The Vulkan layers and extensions wrangler.
Definition: capabilities_vk.h:30
impeller::PipelineCacheVK::IsValid
bool IsValid() const
Definition: pipeline_cache_vk.cc:112
impeller::PipelineCacheVK::CreatePipeline
vk::UniquePipeline CreatePipeline(const vk::GraphicsPipelineCreateInfo &info)
Definition: pipeline_cache_vk.cc:116
impeller
Definition: aiks_context.cc:10