Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Friends | List of all members
impeller::CommandEncoderVK Class Reference

#include <command_encoder_vk.h>

Public Types

using SubmitCallback = std::function< void(bool)>
 

Public Member Functions

 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)
 
 ~CommandEncoderVK ()
 
bool IsValid () const
 
bool Track (std::shared_ptr< SharedObjectVK > object)
 
bool Track (std::shared_ptr< const DeviceBuffer > buffer)
 
bool IsTracking (const std::shared_ptr< const DeviceBuffer > &texture) const
 
bool Track (const std::shared_ptr< const Texture > &texture)
 
bool IsTracking (const std::shared_ptr< const Texture > &texture) const
 
bool Track (std::shared_ptr< const TextureSourceVK > texture)
 
vk::CommandBuffer GetCommandBuffer () const
 
void PushDebugGroup (std::string_view label) const
 
void PopDebugGroup () const
 
void InsertDebugMarker (std::string_view label) const
 
bool EndCommandBuffer () const
 
fml::StatusOr< vk::DescriptorSet > AllocateDescriptorSets (const vk::DescriptorSetLayout &layout, const ContextVK &context)
 

Friends

class ContextVK
 
class CommandQueueVK
 

Detailed Description

Definition at line 50 of file command_encoder_vk.h.

Member Typedef Documentation

◆ SubmitCallback

Definition at line 52 of file command_encoder_vk.h.

Constructor & Destructor Documentation

◆ CommandEncoderVK()

impeller::CommandEncoderVK::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 
)

Definition at line 68 of file command_encoder_vk.cc.

73 : device_holder_(std::move(device_holder)),
74 tracked_objects_(std::move(tracked_objects)),
75 queue_(queue),
76 fence_waiter_(std::move(fence_waiter)) {}
VkQueue queue
Definition: main.cc:55

◆ ~CommandEncoderVK()

impeller::CommandEncoderVK::~CommandEncoderVK ( )
default

Member Function Documentation

◆ AllocateDescriptorSets()

fml::StatusOr< vk::DescriptorSet > impeller::CommandEncoderVK::AllocateDescriptorSets ( const vk::DescriptorSetLayout &  layout,
const ContextVK context 
)

Definition at line 164 of file command_encoder_vk.cc.

166 {
167 if (!IsValid()) {
168 return fml::Status(fml::StatusCode::kUnknown, "command encoder invalid");
169 }
170
171 return tracked_objects_->GetDescriptorPool().AllocateDescriptorSets(layout,
172 context);
173}
Task::Status Status
Definition: TaskList.cpp:15

◆ EndCommandBuffer()

bool impeller::CommandEncoderVK::EndCommandBuffer ( ) const

Definition at line 84 of file command_encoder_vk.cc.

84 {
85 InsertDebugMarker("QueueSubmit");
86
87 auto command_buffer = GetCommandBuffer();
88 tracked_objects_->GetGPUProbe().RecordCmdBufferEnd(command_buffer);
89
90 auto status = command_buffer.end();
91 if (status != vk::Result::eSuccess) {
92 VALIDATION_LOG << "Failed to end command buffer: " << vk::to_string(status);
93 return false;
94 }
95 return true;
96}
vk::CommandBuffer GetCommandBuffer() const
void InsertDebugMarker(std::string_view label) const
static SkString to_string(int n)
Definition: nanobench.cpp:119
#define VALIDATION_LOG
Definition: validation.h:73

◆ GetCommandBuffer()

vk::CommandBuffer impeller::CommandEncoderVK::GetCommandBuffer ( ) const

Definition at line 98 of file command_encoder_vk.cc.

98 {
99 if (tracked_objects_) {
100 return tracked_objects_->GetCommandBuffer();
101 }
102 return {};
103}

◆ InsertDebugMarker()

void impeller::CommandEncoderVK::InsertDebugMarker ( std::string_view  label) const

Definition at line 195 of file command_encoder_vk.cc.

195 {
196 if (!HasValidationLayers()) {
197 return;
198 }
199 vk::DebugUtilsLabelEXT label_info;
200 label_info.pLabelName = label.data();
201 if (auto command_buffer = GetCommandBuffer()) {
202 command_buffer.insertDebugUtilsLabelEXT(label_info);
203 }
204 if (queue_) {
205 queue_->InsertDebugMarker(label);
206 }
207}
bool HasValidationLayers()
Definition: context_vk.cc:48

◆ IsTracking() [1/2]

bool impeller::CommandEncoderVK::IsTracking ( const std::shared_ptr< const DeviceBuffer > &  texture) const

Definition at line 128 of file command_encoder_vk.cc.

129 {
130 if (!IsValid()) {
131 return false;
132 }
133 return tracked_objects_->IsTracking(buffer);
134}
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

◆ IsTracking() [2/2]

bool impeller::CommandEncoderVK::IsTracking ( const std::shared_ptr< const Texture > &  texture) const

Definition at line 154 of file command_encoder_vk.cc.

155 {
156 if (!IsValid()) {
157 return false;
158 }
159 std::shared_ptr<const TextureSourceVK> source =
161 return tracked_objects_->IsTracking(source);
162}
static TextureVK & Cast(Texture &base)
Definition: backend_cast.h:13
std::shared_ptr< const TextureSourceVK > GetTextureSource() const
Definition: texture_vk.cc:155
SkBitmap source
Definition: examples.cpp:28

◆ IsValid()

bool impeller::CommandEncoderVK::IsValid ( ) const

Definition at line 80 of file command_encoder_vk.cc.

80 {
81 return is_valid_;
82}

◆ PopDebugGroup()

void impeller::CommandEncoderVK::PopDebugGroup ( ) const

Definition at line 186 of file command_encoder_vk.cc.

186 {
187 if (!HasValidationLayers()) {
188 return;
189 }
190 if (auto command_buffer = GetCommandBuffer()) {
191 command_buffer.endDebugUtilsLabelEXT();
192 }
193}

◆ PushDebugGroup()

void impeller::CommandEncoderVK::PushDebugGroup ( std::string_view  label) const

Definition at line 175 of file command_encoder_vk.cc.

175 {
176 if (!HasValidationLayers()) {
177 return;
178 }
179 vk::DebugUtilsLabelEXT label_info;
180 label_info.pLabelName = label.data();
181 if (auto command_buffer = GetCommandBuffer()) {
182 command_buffer.beginDebugUtilsLabelEXT(label_info);
183 }
184}

◆ Track() [1/4]

bool impeller::CommandEncoderVK::Track ( const std::shared_ptr< const Texture > &  texture)

Definition at line 144 of file command_encoder_vk.cc.

144 {
145 if (!IsValid()) {
146 return false;
147 }
148 if (!texture) {
149 return true;
150 }
151 return Track(TextureVK::Cast(*texture).GetTextureSource());
152}
bool Track(std::shared_ptr< SharedObjectVK > object)
FlTexture * texture

◆ Track() [2/4]

bool impeller::CommandEncoderVK::Track ( std::shared_ptr< const DeviceBuffer buffer)

Definition at line 120 of file command_encoder_vk.cc.

120 {
121 if (!IsValid()) {
122 return false;
123 }
124 tracked_objects_->Track(std::move(buffer));
125 return true;
126}

◆ Track() [3/4]

bool impeller::CommandEncoderVK::Track ( std::shared_ptr< const TextureSourceVK texture)

Definition at line 136 of file command_encoder_vk.cc.

136 {
137 if (!IsValid()) {
138 return false;
139 }
140 tracked_objects_->Track(std::move(texture));
141 return true;
142}

◆ Track() [4/4]

bool impeller::CommandEncoderVK::Track ( std::shared_ptr< SharedObjectVK object)

Definition at line 112 of file command_encoder_vk.cc.

112 {
113 if (!IsValid()) {
114 return false;
115 }
116 tracked_objects_->Track(std::move(object));
117 return true;
118}

Friends And Related Function Documentation

◆ CommandQueueVK

friend class CommandQueueVK
friend

Definition at line 92 of file command_encoder_vk.h.

◆ ContextVK

friend class ContextVK
friend

Definition at line 91 of file command_encoder_vk.h.


The documentation for this class was generated from the following files: