#include <CommandListAllocator.h>
Inherits AZ::RHI::Object.
Classes | |
struct | Descriptor |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (CommandListAllocator, AZ::SystemAllocator) | |
RHI::ResultCode | Init (const Descriptor &descriptor) |
RHI::Ptr< CommandList > | Allocate (uint32_t familyQueueIndex, VkCommandBufferLevel level) |
void | Collect () |
void | Shutdown () |
Public Member Functions inherited from AZ::RHI::Object | |
AZ_RTTI (Object, "{E43378F1-2331-4173-94B8-990ED20E6003}") | |
void | SetName (const Name &name) |
Sets the name of the object. | |
const Name & | GetName () const |
Returns the name set on the object by SetName. | |
uint32_t | use_count () |
Returns the current use count of the object. | |
Additional Inherited Members | |
Protected Member Functions inherited from AZ::RHI::Object | |
void | add_ref () const |
void | release () const |
Protected Attributes inherited from AZ::RHI::Object | |
AZStd::atomic_int | m_useCount = 0 |
CommandListAllocator combines the CommandListPool, CommandAllocatorPool, and CommandListSubAllocator utilities into a complete allocator implementation that load balances across threads with almost zero contention.
This class is best used with a job system, with 1 job per command list. The job should close the command list on completion, because the next command list recording job on the same thread will use the same internal linear allocator (command allocator).
Each Allocate call pulls from the thread-local command list sub-allocator. CommandPools are reseted as a whole when they are collected and all command lists from the pool are recycled.
|
virtual |
Shuts down the object. Derived classes can make this public if it fits with their lifecycle model (i.e. if they use an explicit Init / Shutdown). By default, it is private in order to maintain consistency with a simpler RAII lifecycle.
Reimplemented from AZ::RHI::Object.