Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::CommandBufferVK Class Referencefinal

#include <command_buffer_vk.h>

Inheritance diagram for impeller::CommandBufferVK:
impeller::CommandBuffer impeller::BackendCast< CommandBufferVK, CommandBuffer >

Public Member Functions

 ~CommandBufferVK () override
 
bool Track (const std::shared_ptr< SharedObjectVK > &object)
 Ensure that [object] is kept alive until this command buffer completes execution.
 
bool Track (const std::shared_ptr< const DeviceBuffer > &buffer)
 Ensure that [buffer] is kept alive until this command buffer completes execution.
 
bool Track (const std::shared_ptr< const Texture > &texture)
 Ensure that [texture] is kept alive until this command buffer completes execution.
 
bool Track (const std::shared_ptr< const TextureSourceVK > &texture)
 Ensure that [texture] is kept alive until this command buffer completes execution.
 
vk::CommandBuffer GetCommandBuffer () const
 Retrieve the native command buffer from this object.
 
void PushDebugGroup (std::string_view label) const
 Push a debug group.
 
void PopDebugGroup () const
 Pop the previous debug group.
 
void InsertDebugMarker (std::string_view label) const
 Insert a new debug marker.
 
bool EndCommandBuffer () const
 End recording of the current command buffer.
 
fml::StatusOr< vk::DescriptorSet > AllocateDescriptorSets (const vk::DescriptorSetLayout &layout, PipelineKey pipeline_key, const ContextVK &context)
 Allocate a new descriptor set for the given [layout].
 
DescriptorPoolVKGetDescriptorPool () const
 
- Public Member Functions inherited from impeller::CommandBuffer
virtual ~CommandBuffer ()
 
void WaitUntilCompleted ()
 Block the current thread until the GPU has completed execution of the commands.
 
void WaitUntilScheduled ()
 Block the current thread until the GPU has completed scheduling execution of the commands.
 
std::shared_ptr< RenderPassCreateRenderPass (const RenderTarget &render_target)
 Create a render pass to record render commands into.
 
std::shared_ptr< BlitPassCreateBlitPass ()
 Create a blit pass to record blit commands into.
 
std::shared_ptr< ComputePassCreateComputePass ()
 Create a compute pass to record compute commands into.
 

Friends

class ContextVK
 
class CommandQueueVK
 

Additional Inherited Members

- Public Types inherited from impeller::CommandBuffer
enum class  Status {
  kPending ,
  kError ,
  kCompleted
}
 
using CompletionCallback = std::function< void(Status)>
 
- Static Public Member Functions inherited from impeller::BackendCast< CommandBufferVK, CommandBuffer >
static CommandBufferVKCast (CommandBuffer &base)
 
static const CommandBufferVKCast (const CommandBuffer &base)
 
static CommandBufferVKCast (CommandBuffer *base)
 
static const CommandBufferVKCast (const CommandBuffer *base)
 
- Protected Member Functions inherited from impeller::CommandBuffer
 CommandBuffer (std::weak_ptr< const Context > context)
 
- Protected Attributes inherited from impeller::CommandBuffer
std::weak_ptr< const Contextcontext_
 

Detailed Description

Definition at line 23 of file command_buffer_vk.h.

Constructor & Destructor Documentation

◆ ~CommandBufferVK()

impeller::CommandBufferVK::~CommandBufferVK ( )
overridedefault

Member Function Documentation

◆ AllocateDescriptorSets()

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

Allocate a new descriptor set for the given [layout].

Definition at line 160 of file command_buffer_vk.cc.

163 {
164 if (!IsValid()) {
165 return fml::Status(fml::StatusCode::kUnknown, "command encoder invalid");
166 }
167
168 return tracked_objects_->GetDescriptorPool().AllocateDescriptorSets(
169 layout, pipeline_key, context);
170}
std::shared_ptr< ContextGLES > context

References context, and fml::kUnknown.

◆ EndCommandBuffer()

bool impeller::CommandBufferVK::EndCommandBuffer ( ) const

End recording of the current command buffer.

Definition at line 104 of file command_buffer_vk.cc.

104 {
105 InsertDebugMarker("QueueSubmit");
106
108 tracked_objects_->GetGPUProbe().RecordCmdBufferEnd(command_buffer);
109
110 auto status = command_buffer.end();
111 if (status != vk::Result::eSuccess) {
112 VALIDATION_LOG << "Failed to end command buffer: " << vk::to_string(status);
113 return false;
114 }
115 return true;
116}
void InsertDebugMarker(std::string_view label) const
Insert a new debug marker.
vk::CommandBuffer GetCommandBuffer() const
Retrieve the native command buffer from this object.
std::shared_ptr< CommandBuffer > command_buffer
#define VALIDATION_LOG
Definition validation.h:91

References command_buffer, and VALIDATION_LOG.

Referenced by flutter::SetTextureLayout().

◆ GetCommandBuffer()

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

Retrieve the native command buffer from this object.

Definition at line 118 of file command_buffer_vk.cc.

118 {
119 if (tracked_objects_) {
120 return tracked_objects_->GetCommandBuffer();
121 }
122 return {};
123}

Referenced by impeller::GPUTracerVK::InitializeQueryPool(), flutter::SetTextureLayout(), and impeller::testing::TEST().

◆ GetDescriptorPool()

DescriptorPoolVK & impeller::CommandBufferVK::GetDescriptorPool ( ) const

Definition at line 203 of file command_buffer_vk.cc.

203 {
204 return tracked_objects_->GetDescriptorPool();
205}

Referenced by impeller::testing::TEST().

◆ InsertDebugMarker()

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

Insert a new debug marker.

This label is only visible in debuggers like RenderDoc. This function is ignored in release builds.

Definition at line 192 of file command_buffer_vk.cc.

192 {
193 if (!HasValidationLayers()) {
194 return;
195 }
196 vk::DebugUtilsLabelEXT label_info;
197 label_info.pLabelName = label.data();
198 if (auto command_buffer = GetCommandBuffer()) {
199 command_buffer.insertDebugUtilsLabelEXT(label_info);
200 }
201}
bool HasValidationLayers()
Definition context_vk.cc:53

References command_buffer, and impeller::HasValidationLayers().

◆ PopDebugGroup()

void impeller::CommandBufferVK::PopDebugGroup ( ) const

Pop the previous debug group.

This label is only visible in debuggers like RenderDoc. This function is ignored in release builds.

Definition at line 183 of file command_buffer_vk.cc.

183 {
184 if (!HasValidationLayers()) {
185 return;
186 }
187 if (auto command_buffer = GetCommandBuffer()) {
188 command_buffer.endDebugUtilsLabelEXT();
189 }
190}

References command_buffer, and impeller::HasValidationLayers().

◆ PushDebugGroup()

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

Push a debug group.

This label is only visible in debuggers like RenderDoc. This function is ignored in release builds.

Definition at line 172 of file command_buffer_vk.cc.

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

References command_buffer, and impeller::HasValidationLayers().

◆ Track() [1/4]

bool impeller::CommandBufferVK::Track ( const std::shared_ptr< const DeviceBuffer > &  buffer)

Ensure that [buffer] is kept alive until this command buffer completes execution.

Definition at line 133 of file command_buffer_vk.cc.

133 {
134 if (!IsValid()) {
135 return false;
136 }
137 tracked_objects_->Track(buffer);
138 return true;
139}

◆ Track() [2/4]

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

Ensure that [texture] is kept alive until this command buffer completes execution.

Definition at line 150 of file command_buffer_vk.cc.

150 {
151 if (!IsValid()) {
152 return false;
153 }
154 if (!texture) {
155 return true;
156 }
157 return Track(TextureVK::Cast(*texture).GetTextureSource());
158}
static TextureVK & Cast(Texture &base)
bool Track(const std::shared_ptr< SharedObjectVK > &object)
Ensure that [object] is kept alive until this command buffer completes execution.
std::shared_ptr< const TextureSourceVK > GetTextureSource() const
FlTexture * texture

References texture.

◆ Track() [3/4]

bool impeller::CommandBufferVK::Track ( const std::shared_ptr< const TextureSourceVK > &  texture)

Ensure that [texture] is kept alive until this command buffer completes execution.

Definition at line 141 of file command_buffer_vk.cc.

142 {
143 if (!IsValid()) {
144 return false;
145 }
146 tracked_objects_->Track(texture);
147 return true;
148}

References texture.

◆ Track() [4/4]

bool impeller::CommandBufferVK::Track ( const std::shared_ptr< SharedObjectVK > &  object)

Ensure that [object] is kept alive until this command buffer completes execution.

Definition at line 125 of file command_buffer_vk.cc.

125 {
126 if (!IsValid()) {
127 return false;
128 }
129 tracked_objects_->Track(object);
130 return true;
131}

Friends And Related Symbol Documentation

◆ CommandQueueVK

friend class CommandQueueVK
friend

Definition at line 84 of file command_buffer_vk.h.

◆ ContextVK

friend class ContextVK
friend

Definition at line 83 of file command_buffer_vk.h.


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