Flutter Engine
 
Loading...
Searching...
No Matches
impeller::CommandQueue Class Reference

An interface for submitting command buffers to the GPU for encoding and execution. More...

#include <command_queue.h>

Inheritance diagram for impeller::CommandQueue:
impeller::CommandQueueVK impeller::testing::MockCommandQueue

Public Types

using CompletionCallback = std::function< void(CommandBuffer::Status)>
 

Public Member Functions

 CommandQueue ()
 
virtual ~CommandQueue ()
 
virtual fml::Status Submit (const std::vector< std::shared_ptr< CommandBuffer > > &buffers, const CompletionCallback &completion_callback={}, bool block_on_schedule=false)
 Submit one or more command buffer objects to be encoded and executed on the GPU.
 

Detailed Description

An interface for submitting command buffers to the GPU for encoding and execution.

Definition at line 17 of file command_queue.h.

Member Typedef Documentation

◆ CompletionCallback

Definition at line 19 of file command_queue.h.

Constructor & Destructor Documentation

◆ CommandQueue()

impeller::CommandQueue::CommandQueue ( )
default

◆ ~CommandQueue()

impeller::CommandQueue::~CommandQueue ( )
virtualdefault

Member Function Documentation

◆ Submit()

fml::Status impeller::CommandQueue::Submit ( const std::vector< std::shared_ptr< CommandBuffer > > &  buffers,
const CompletionCallback completion_callback = {},
bool  block_on_schedule = false 
)
virtual

Submit one or more command buffer objects to be encoded and executed on the GPU.

The order of the provided buffers determines the ordering in which they are submitted.

The returned status only indicates if the command buffer was successfully submitted. Successful completion of the command buffer can only be checked in the optional completion callback.

Only the Metal and Vulkan backends can give a status beyond successful encoding. This callback may be called more than once and potentially on a different thread.

If [block_on_schedule] is true, this function will not return until the command buffer has been scheduled. This only impacts the Metal backend.

Reimplemented in impeller::CommandQueueVK.

Definition at line 14 of file command_queue.cc.

17 {
18 if (buffers.empty()) {
19 if (completion_callback) {
20 completion_callback(CommandBuffer::Status::kError);
21 }
23 "No command buffers provided.");
24 }
25 for (const std::shared_ptr<CommandBuffer>& buffer : buffers) {
26 if (!buffer->SubmitCommands(block_on_schedule, completion_callback)) {
28 "Failed to submit command buffer.");
29 }
30 }
31 return fml::Status();
32}
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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98

References fml::kCancelled, impeller::CommandBuffer::kError, and fml::kInvalidArgument.


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