| Flutter Impeller |

Public Types | Public Member Functions | List of all members
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:

## 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={})
| Submit one or more command buffer objects to be encoded and executed on the GPU. More...

## 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

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

Definition at line 19 of file command_queue.h.

## Constructor & Destructor Documentation

## ◆ CommandQueue()

impeller::CommandQueue::CommandQueue | ( |  | ) |
| default

## ◆ ~CommandQueue()

impeller::CommandQueue::~CommandQueue | ( |  | ) |
| virtual default

## Member Function Documentation

## ◆ Submit()

fml::Status impeller::CommandQueue::Submit | ( | const std::vector< std::shared_ptr< CommandBuffer >> & | buffers,
|  | const CompletionCallback & | completion_callback = `{}`
| ) |  |
| 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.

Reimplemented in impeller::CommandQueueVK.

Definition at line 14 of file command_queue.cc.

16 {
17 if (buffers.empty()) {
18 if (completion_callback) {
19 completion_callback(CommandBuffer::Status::kError);
20 }
21 return fml::Status(fml::StatusCode::kInvalidArgument,
22 "No command buffers provided.");
23 }
24 for (const std::shared_ptr<CommandBuffer>& buffer : buffers) {
25 if (!buffer->SubmitCommands(completion_callback)) {
26 return fml::Status(fml::StatusCode::kCancelled,
27 "Failed to submit command buffer.");
28 }
29 }
30 return fml::Status();
31 }
impeller::CommandBuffer::Status::kError
@ kError

References impeller::CommandBuffer::kError.

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

- impeller/renderer/command_queue.h
- impeller/renderer/command_queue.cc