Flutter Engine
The Flutter Engine
tracked_objects_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_TRACKED_OBJECTS_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TRACKED_OBJECTS_VK_H_
7
8#include <memory>
9
12
13namespace impeller {
14
15/// @brief A per-frame object used to track resource lifetimes and allocate
16/// command buffers and descriptor sets.
18 public:
19 explicit TrackedObjectsVK(const std::weak_ptr<const ContextVK>& context,
20 const std::shared_ptr<CommandPoolVK>& pool,
21 std::unique_ptr<GPUProbe> probe);
22
24
25 bool IsValid() const;
26
27 void Track(std::shared_ptr<SharedObjectVK> object);
28
29 void Track(std::shared_ptr<const DeviceBuffer> buffer);
30
31 bool IsTracking(const std::shared_ptr<const DeviceBuffer>& buffer) const;
32
33 void Track(std::shared_ptr<const TextureSourceVK> texture);
34
35 bool IsTracking(const std::shared_ptr<const TextureSourceVK>& texture) const;
36
37 vk::CommandBuffer GetCommandBuffer() const;
38
40
41 GPUProbe& GetGPUProbe() const;
42
43 private:
44 DescriptorPoolVK desc_pool_;
45 // `shared_ptr` since command buffers have a link to the command pool.
46 std::shared_ptr<CommandPoolVK> pool_;
47 vk::UniqueCommandBuffer buffer_;
48 std::set<std::shared_ptr<SharedObjectVK>> tracked_objects_;
49 std::set<std::shared_ptr<const DeviceBuffer>> tracked_buffers_;
50 std::set<std::shared_ptr<const TextureSourceVK>> tracked_textures_;
51 std::unique_ptr<GPUProbe> probe_;
52 bool is_valid_ = false;
53
54 TrackedObjectsVK(const TrackedObjectsVK&) = delete;
55
56 TrackedObjectsVK& operator=(const TrackedObjectsVK&) = delete;
57};
58
59} // namespace impeller
60
61#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TRACKED_OBJECTS_VK_H_
AutoreleasePool pool
A per-frame descriptor pool. Descriptors from this pool don't need to be freed individually....
A per-frame object used to track resource lifetimes and allocate command buffers and descriptor sets.
GPUProbe & GetGPUProbe() const
TrackedObjectsVK(const std::weak_ptr< const ContextVK > &context, const std::shared_ptr< CommandPoolVK > &pool, std::unique_ptr< GPUProbe > probe)
void Track(std::shared_ptr< SharedObjectVK > object)
DescriptorPoolVK & GetDescriptorPool()
bool IsTracking(const std::shared_ptr< const DeviceBuffer > &buffer) const
vk::CommandBuffer GetCommandBuffer() const
FlTexture * texture
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126