Flutter Engine
The Flutter Engine
command_encoder_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_COMMAND_ENCODER_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_ENCODER_VK_H_
7
8#include <cstdint>
9#include <functional>
10#include <optional>
11
20
21namespace impeller {
22
23class ContextVK;
24class DeviceBuffer;
25class Buffer;
26class Texture;
27class TextureSourceVK;
28class TrackedObjectsVK;
29class FenceWaiterVK;
30class GPUProbe;
31
33 public:
35 const std::weak_ptr<const ContextVK>& context);
36
37 std::shared_ptr<CommandEncoderVK> Create();
38
39 void SetLabel(const std::string& label);
40
41 private:
42 std::weak_ptr<const ContextVK> context_;
43 std::optional<std::string> label_;
44
46
47 CommandEncoderFactoryVK& operator=(const CommandEncoderFactoryVK&) = delete;
48};
49
51 public:
52 using SubmitCallback = std::function<void(bool)>;
53
54 // Visible for testing.
55 CommandEncoderVK(std::weak_ptr<const DeviceHolderVK> device_holder,
56 std::shared_ptr<TrackedObjectsVK> tracked_objects,
57 const std::shared_ptr<QueueVK>& queue,
58 std::shared_ptr<FenceWaiterVK> fence_waiter);
59
61
62 bool IsValid() const;
63
64 bool Track(std::shared_ptr<SharedObjectVK> object);
65
66 bool Track(std::shared_ptr<const DeviceBuffer> buffer);
67
68 bool IsTracking(const std::shared_ptr<const DeviceBuffer>& texture) const;
69
70 bool Track(const std::shared_ptr<const Texture>& texture);
71
72 bool IsTracking(const std::shared_ptr<const Texture>& texture) const;
73
74 bool Track(std::shared_ptr<const TextureSourceVK> texture);
75
76 vk::CommandBuffer GetCommandBuffer() const;
77
78 void PushDebugGroup(std::string_view label) const;
79
80 void PopDebugGroup() const;
81
82 void InsertDebugMarker(std::string_view label) const;
83
84 bool EndCommandBuffer() const;
85
87 const vk::DescriptorSetLayout& layout,
88 const ContextVK& context);
89
90 private:
91 friend class ContextVK;
92 friend class CommandQueueVK;
93
94 std::weak_ptr<const DeviceHolderVK> device_holder_;
95 std::shared_ptr<TrackedObjectsVK> tracked_objects_;
96 std::shared_ptr<QueueVK> queue_;
97 const std::shared_ptr<FenceWaiterVK> fence_waiter_;
98 std::shared_ptr<HostBuffer> host_buffer_;
99 bool is_valid_ = true;
100
101 void Reset();
102
103 CommandEncoderVK(const CommandEncoderVK&) = delete;
104
105 CommandEncoderVK& operator=(const CommandEncoderVK&) = delete;
106};
107
108} // namespace impeller
109
110#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_ENCODER_VK_H_
std::shared_ptr< CommandEncoderVK > Create()
void SetLabel(const std::string &label)
CommandEncoderFactoryVK(const std::weak_ptr< const ContextVK > &context)
void PushDebugGroup(std::string_view label) const
bool Track(std::shared_ptr< SharedObjectVK > object)
CommandEncoderVK(std::weak_ptr< const DeviceHolderVK > device_holder, std::shared_ptr< TrackedObjectsVK > tracked_objects, const std::shared_ptr< QueueVK > &queue, std::shared_ptr< FenceWaiterVK > fence_waiter)
vk::CommandBuffer GetCommandBuffer() const
bool IsTracking(const std::shared_ptr< const DeviceBuffer > &texture) const
std::function< void(bool)> SubmitCallback
fml::StatusOr< vk::DescriptorSet > AllocateDescriptorSets(const vk::DescriptorSetLayout &layout, const ContextVK &context)
void InsertDebugMarker(std::string_view label) const
VkQueue queue
Definition: main.cc:55
Dart_NativeFunction function
Definition: fuchsia.cc:51
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
void Reset(SkPath *path)
Definition: path_ops.cc:40