| 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::unique_ptr< GPUProbe > probe)
| ~TrackedObjectsVK ()
bool | IsValid () const
void | Track (std::shared_ptr< SharedObjectVK > object)
void | Track (std::shared_ptr< const DeviceBuffer > buffer)
bool | IsTracking (const std::shared_ptr< const DeviceBuffer > &buffer) const
void | Track (std::shared_ptr< const TextureSourceVK > texture)
bool | IsTracking (const std::shared_ptr< const TextureSourceVK > &texture) const
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 17 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::unique_ptr< GPUProbe > | probe
| ) |  |
| explicit

Definition at line 11 of file tracked_objects_vk.cc.

15 : desc_pool_(context), probe_(std::move(probe)) {
16 if (!pool) {
17 return;
18 }
19 auto buffer = pool->CreateCommandBuffer();
20 if (!buffer) {
21 return;
22 }
23 pool_ = pool;
24 buffer_ = std::move(buffer);
25 is_valid_ = true;
26 }

## ◆ ~TrackedObjectsVK()

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

Definition at line 28 of file tracked_objects_vk.cc.

28 {
29 if (!buffer_) {
30 return;
31 }
32 pool_->CollectCommandBuffer(std::move(buffer_));
33 }

## Member Function Documentation

## ◆ GetCommandBuffer()

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

Definition at line 76 of file tracked_objects_vk.cc.

76 {
77 return *buffer_;
78 }

## ◆ GetDescriptorPool()

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

Definition at line 80 of file tracked_objects_vk.cc.

80 {
81 return desc_pool_;
82 }

## ◆ GetGPUProbe()

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

Definition at line 84 of file tracked_objects_vk.cc.

84 {
85 return *probe_.get();
86 }

## ◆ IsTracking() [1/2]

bool impeller::TrackedObjectsVK::IsTracking | ( | const std::shared_ptr< const DeviceBuffer > & | buffer | ) | const

Definition at line 53 of file tracked_objects_vk.cc.

54 {
55 if (!buffer) {
56 return false;
57 }
58 return tracked_buffers_.find(buffer) != tracked_buffers_.end();
59 }

## ◆ IsTracking() [2/2]

bool impeller::TrackedObjectsVK::IsTracking | ( | const std::shared_ptr< const TextureSourceVK > & | texture | ) | const

Definition at line 68 of file tracked_objects_vk.cc.

69 {
70 if (!texture) {
71 return false;
72 }
73 return tracked_textures_.find(texture) != tracked_textures_.end();
74 }

## ◆ IsValid()

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

Definition at line 35 of file tracked_objects_vk.cc.

35 {
36 return is_valid_;
37 }

## ◆ Track() [1/3]

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

Definition at line 46 of file tracked_objects_vk.cc.

46 {
47 if (!buffer) {
48 return;
49 }
50 tracked_buffers_.insert(std::move(buffer));
51 }

## ◆ Track() [2/3]

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

Definition at line 61 of file tracked_objects_vk.cc.

61 {
62 if (!texture) {
63 return;
64 }
65 tracked_textures_.insert(std::move(texture));
66 }

## ◆ Track() [3/3]

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

Definition at line 39 of file tracked_objects_vk.cc.

39 {
40 if (!object) {
41 return;
42 }
43 tracked_objects_.insert(std::move(object));
44 }

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