| Flutter Impeller |

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
impeller::QueuesVK Struct Reference

The collection of queues used by the context. The queues may all be the same. More...

`#include <queue_vk.h>`

## Public Member Functions
| QueuesVK ()
| QueuesVK (std::shared_ptr< QueueVK > graphics_queue, std::shared_ptr< QueueVK > compute_queue, std::shared_ptr< QueueVK > transfer_queue)
bool | IsValid () const

## Static Public Member Functions
static QueuesVK | FromEmbedderQueue (vk::Queue queue, uint32_t queue_family_index)
static QueuesVK | FromQueueIndices (const vk::Device &device, QueueIndexVK graphics, QueueIndexVK compute, QueueIndexVK transfer)

## Public Attributes
std::shared_ptr< QueueVK > | graphics_queue
std::shared_ptr< QueueVK > | compute_queue
std::shared_ptr< QueueVK > | transfer_queue

## Detailed Description

The collection of queues used by the context. The queues may all be the same.

Definition at line 63 of file queue_vk.h.

## Constructor & Destructor Documentation

## ◆ QueuesVK() [1/2]

impeller::QueuesVK::QueuesVK | ( |  | ) |
| default

Referenced by FromEmbedderQueue(), and FromQueueIndices().

## ◆ QueuesVK() [2/2]

impeller::QueuesVK::QueuesVK | ( | std::shared_ptr< QueueVK > | graphics_queue,
|  | std::shared_ptr< QueueVK > | compute_queue,
|  | std::shared_ptr< QueueVK > | transfer_queue
| ) |  |

Definition at line 50 of file queue_vk.cc.

53 : graphics_queue(std::move(graphics_queue)),
54 compute_queue(std::move(compute_queue)),
55 transfer_queue(std::move(transfer_queue)) {}

## Member Function Documentation

## ◆ FromEmbedderQueue()

QueuesVK impeller::QueuesVK::FromEmbedderQueue | ( | vk::Queue | queue,
|  | uint32_t | queue_family_index
| ) |  |
| static

Definition at line 58 of file queue_vk.cc.

59 {
60 auto graphics_queue = std::make_shared<QueueVK>(
61 QueueIndexVK{.family = queue_family_index, .index = 0}, queue);
62
63 return QueuesVK(graphics_queue, graphics_queue, graphics_queue);
64 }

References impeller::QueueIndexVK::family, graphics_queue, and QueuesVK().

## ◆ FromQueueIndices()

QueuesVK impeller::QueuesVK::FromQueueIndices | ( | const vk::Device & | device,
|  | QueueIndexVK | graphics,
|  | QueueIndexVK | compute,
|  | QueueIndexVK | transfer
| ) |  |
| static

Definition at line 67 of file queue_vk.cc.

70 {
71 auto vk_graphics = device.getQueue(graphics.family, graphics.index);
72 auto vk_compute = device.getQueue(compute.family, compute.index);
73 auto vk_transfer = device.getQueue(transfer.family, transfer.index);
74
75 // Always set up the graphics queue.
76 auto graphics_queue = std::make_shared<QueueVK>(graphics, vk_graphics);
77 ContextVK::SetDebugName(device, vk_graphics, "ImpellerGraphicsQ");
78
79 // Setup the compute queue if its different from the graphics queue.
80 std::shared_ptr<QueueVK> compute_queue;
81 if (compute == graphics) {
82 compute_queue = graphics_queue;
83 } else {
84 compute_queue = std::make_shared<QueueVK>(compute, vk_compute);
85 ContextVK::SetDebugName(device, vk_compute, "ImpellerComputeQ");
86 }
87
88 // Setup the transfer queue if its different from the graphics or compute
89 // queues.
90 std::shared_ptr<QueueVK> transfer_queue;
91 if (transfer == graphics) {
92 transfer_queue = graphics_queue;
93 } else if (transfer == compute) {
94 transfer_queue = compute_queue;
95 } else {
96 transfer_queue = std::make_shared<QueueVK>(transfer, vk_transfer);
97 ContextVK::SetDebugName(device, vk_transfer, "ImpellerTransferQ");
98 }
99
100 return QueuesVK(std::move(graphics_queue), std::move(compute_queue),
101 std::move(transfer_queue));
102 }

References compute_queue, impeller::QueueIndexVK::family, graphics_queue, impeller::QueueIndexVK::index, QueuesVK(), impeller::ContextVK::SetDebugName(), and transfer_queue.

## ◆ IsValid()

bool impeller::QueuesVK::IsValid | ( |  | ) | const

Definition at line 104 of file queue_vk.cc.

104 {
105 return graphics_queue && compute_queue && transfer_queue;
106 }

References compute_queue, graphics_queue, and transfer_queue.

## Member Data Documentation

## ◆ compute_queue

std::shared_ptr<QueueVK> impeller::QueuesVK::compute_queue

Definition at line 65 of file queue_vk.h.

Referenced by FromQueueIndices(), and IsValid().

## ◆ graphics_queue

std::shared_ptr<QueueVK> impeller::QueuesVK::graphics_queue

Definition at line 64 of file queue_vk.h.

Referenced by FromEmbedderQueue(), FromQueueIndices(), impeller::ContextVK::GetGraphicsQueue(), and IsValid().

## ◆ transfer_queue

std::shared_ptr<QueueVK> impeller::QueuesVK::transfer_queue

Definition at line 66 of file queue_vk.h.

Referenced by FromQueueIndices(), and IsValid().

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

- impeller/renderer/backend/vulkan/queue_vk.h
- impeller/renderer/backend/vulkan/queue_vk.cc

impeller::QueuesVK::graphics_queue
std::shared_ptr< QueueVK > graphics_queue
Definition: queue_vk.h:64
impeller::QueuesVK::transfer_queue
std::shared_ptr< QueueVK > transfer_queue
Definition: queue_vk.h:66
impeller::QueuesVK::compute_queue
std::shared_ptr< QueueVK > compute_queue
Definition: queue_vk.h:65
impeller::ContextVK::SetDebugName
bool SetDebugName(T handle, std::string_view label) const
Definition: context_vk.h:150
impeller::QueuesVK::QueuesVK
QueuesVK()