#include <ObjectCollector.h>
Classes | |
struct | Descriptor |
Public Types | |
using | ObjectType = typename Traits::ObjectType |
using | ObjectPtrType = Ptr< ObjectType > |
using | CollectFunction = AZStd::function< void(ObjectType &)> |
Public Member Functions | |
void | Init (const Descriptor &descriptor) |
void | Shutdown () |
void | QueueForCollect (ObjectPtrType object) |
Queues a single pointer for collection. | |
void | QueueForCollect (ObjectType *objects, size_t objectCount) |
Queues an array of objects for collection. | |
void | QueueForCollect (ObjectType **objects, size_t objectCount) |
Queues an array of pointers to the object for collection. | |
void | Collect (bool forceFlush=false) |
size_t | GetObjectCount () const |
void | Notify (ObjectCollectorNotifyFunction notifyFunction) |
Notifies after the current set of pending objects is released. | |
Deferred-releases reference-counted objects at a specific latency. Example: Use to batch-release objects that exist on the GPU timeline at the end of the frame after syncing the oldest GPU frame.
using AZ::RHI::ObjectCollector< Traits >::CollectFunction = AZStd::function<void(ObjectType&)> |
This method is called when the collection pass is releasing an object. The user can provide their own "collector" function to do something other than release (e.g. reuse from a pool).
void AZ::RHI::ObjectCollector< Traits >::Collect | ( | bool | forceFlush = false | ) |
Runs a collection cycle. All objects scheduled for collection (according to the collection latency) are provided to the collect function (if it exists), and the references are released.
size_t AZ::RHI::ObjectCollector< Traits >::GetObjectCount |
Returns the number of objects pending to be collected. Must not be called at collection time.