Flutter Engine
 
Loading...
Searching...
No Matches
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
 
DescriptorPoolVKGetDescriptorPool ()
 
GPUProbeGetGPUProbe () 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}
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

◆ ~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}
FlTexture * texture

References texture.

◆ 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: