| Flutter Impeller |

Public Member Functions | List of all members
impeller::TrackedObjectsVK Class Reference

A per-frame object used to track resource lifetimes and allocate command buffers and descriptor sets. More...

`#include <tracked_objects_vk.h>`

## Public Member Functions
| TrackedObjectsVK (const std::weak_ptr< const ContextVK > &context, const std::shared_ptr< CommandPoolVK > &pool, std::shared_ptr< DescriptorPoolVK > descriptor_pool, std::unique_ptr< GPUProbe > probe)
| ~TrackedObjectsVK ()
bool | IsValid () const
void | Track (const std::shared_ptr< SharedObjectVK > &object)
void | Track (const std::shared_ptr< const DeviceBuffer > &buffer)
void | Track (const std::shared_ptr< const TextureSourceVK > &texture)
vk::CommandBuffer | GetCommandBuffer () const
DescriptorPoolVK & | GetDescriptorPool ()
GPUProbe & | GetGPUProbe () const

## Detailed Description

A per-frame object used to track resource lifetimes and allocate command buffers and descriptor sets.

Definition at line 19 of file tracked_objects_vk.h.

## Constructor & Destructor Documentation

## ◆ TrackedObjectsVK()

impeller::TrackedObjectsVK::TrackedObjectsVK | ( | const std::weak_ptr< const ContextVK > & | context,
|  | const std::shared_ptr< CommandPoolVK > & | pool,
|  | std::shared_ptr< DescriptorPoolVK > | descriptor_pool,
|  | std::unique_ptr< GPUProbe > | probe
| ) |  |
| explicit

Definition at line 12 of file tracked_objects_vk.cc.

17 : desc_pool_(std::move(descriptor_pool)), probe_(std::move(probe)) {
18 if (!pool) {
19 return;
20 }
21 auto buffer = pool->CreateCommandBuffer();
22 if (!buffer) {
23 return;
24 }
25 pool_ = pool;
26 buffer_ = std::move(buffer);
27 is_valid_ = true;
28 // Starting values were selected by looking at values from
29 // AiksTest.CanRenderMultipleBackdropBlurWithSingleBackdropId.
30 tracked_objects_.reserve(5);
31 tracked_buffers_.reserve(5);
32 tracked_textures_.reserve(5);
33 }

## ◆ ~TrackedObjectsVK()

impeller::TrackedObjectsVK::~TrackedObjectsVK | ( |  | ) |

Definition at line 35 of file tracked_objects_vk.cc.

35 {
36 if (!buffer_) {
37 return;
38 }
39 pool_->CollectCommandBuffer(std::move(buffer_));
40 }

## Member Function Documentation

## ◆ GetCommandBuffer()

vk::CommandBuffer impeller::TrackedObjectsVK::GetCommandBuffer | ( |  | ) | const

Definition at line 72 of file tracked_objects_vk.cc.

72 {
73 return *buffer_;
74 }

## ◆ GetDescriptorPool()

DescriptorPoolVK & impeller::TrackedObjectsVK::GetDescriptorPool | ( |  | ) |

Definition at line 76 of file tracked_objects_vk.cc.

76 {
77 return *desc_pool_;
78 }

## ◆ GetGPUProbe()

GPUProbe & impeller::TrackedObjectsVK::GetGPUProbe | ( |  | ) | const

Definition at line 80 of file tracked_objects_vk.cc.

80 {
81 return *probe_.get();
82 }

## ◆ IsValid()

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

Definition at line 42 of file tracked_objects_vk.cc.

42 {
43 return is_valid_;
44 }

## ◆ Track() [1/3]

void impeller::TrackedObjectsVK::Track | ( | const std::shared_ptr< const DeviceBuffer > & | buffer | ) |

Definition at line 54 of file tracked_objects_vk.cc.

55 {
56 if (!buffer || (!tracked_buffers_.empty() &&
57 buffer.get() == tracked_buffers_.back().get())) {
58 return;
59 }
60 tracked_buffers_.emplace_back(buffer);
61 }

## ◆ Track() [2/3]

void impeller::TrackedObjectsVK::Track | ( | const std::shared_ptr< const TextureSourceVK > & | texture | ) |

Definition at line 63 of file tracked_objects_vk.cc.

64 {
65 if (!texture || (!tracked_textures_.empty() &&
66 texture.get() == tracked_textures_.back().get())) {
67 return;
68 }
69 tracked_textures_.emplace_back(texture);
70 }

## ◆ Track() [3/3]

void impeller::TrackedObjectsVK::Track | ( | const std::shared_ptr< SharedObjectVK > & | object | ) |

Definition at line 46 of file tracked_objects_vk.cc.

46 {
47 if (!object || (!tracked_objects_.empty() &&
48 object.get() == tracked_objects_.back().get())) {
49 return;
50 }
51 tracked_objects_.emplace_back(object);
52 }

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

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