Flutter Engine
The Flutter Engine
|
A resource manager controls how resources are allocated and reclaimed. More...
#include <resource_manager_vk.h>
Public Member Functions | |
void | Reclaim (std::unique_ptr< ResourceVK > resource) |
Mark a resource as being reclaimable. More... | |
~ResourceManagerVK () | |
Destroys the resource manager. More... | |
Static Public Member Functions | |
static std::shared_ptr< ResourceManagerVK > | Create () |
Creates a shared resource manager (a dedicated thread). More... | |
A resource manager controls how resources are allocated and reclaimed.
Reclaimed resources are collected in a batch on a separate thread. In the future, the resource manager may allow resource pooling/reuse, delaying reclamation past frame workloads, etc...
Definition at line 37 of file resource_manager_vk.h.
impeller::ResourceManagerVK::~ResourceManagerVK | ( | ) |
Destroys the resource manager.
The resource manager will stop collecting resources and will be destroyed when all references to it are dropped.
Definition at line 25 of file resource_manager_vk.cc.
|
static |
Creates a shared resource manager (a dedicated thread).
Upon creation, a thread is spawned which will collect resources as they are reclaimed (passed to Reclaim
). The thread will exit when the resource manager is destroyed.
Definition at line 14 of file resource_manager_vk.cc.
void impeller::ResourceManagerVK::Reclaim | ( | std::unique_ptr< ResourceVK > | resource | ) |
Mark a resource as being reclaimable.
The resource will be reset at some point in the future.
[in] | resource | The resource to reclaim. |
UniqueResourceVKT
to create a unique handle to a resource, which will call this method. Definition at line 75 of file resource_manager_vk.cc.