#include <TransientAttachmentPool.h>
Inherits AZ::RHI::DeviceObject.
Inherited by AZ::DX12::TransientAttachmentPool, AZ::Metal::TransientAttachmentPool, AZ::Null::TransientAttachmentPool, and AZ::Vulkan::TransientAttachmentPool.
|
| AZ_RTTI (TransientAttachmentPool, "{D4A544E9-AE4A-4BD7-9E03-646DA8D86388}") |
|
ResultCode | Init (Device &device, const TransientAttachmentPoolDescriptor &descriptor) |
| Called to initialize the pool.
|
|
void | Shutdown () |
| Called to shutdown the pool.
|
|
void | Begin (const TransientAttachmentPoolCompileFlags flags=TransientAttachmentPoolCompileFlags::None, const TransientAttachmentStatistics::MemoryUsage *memoryHint=nullptr) |
|
void | BeginScope (Scope &scopeBase) |
| Called when a new scope is being allocated. Scopes are allocated in submission order.
|
|
virtual Image * | ActivateImage (const TransientImageDescriptor &descriptor)=0 |
|
virtual Buffer * | ActivateBuffer (const TransientBufferDescriptor &descriptor)=0 |
|
virtual void | DeactivateBuffer (const AttachmentId &attachmentId)=0 |
|
virtual void | DeactivateImage (const AttachmentId &attachmentId)=0 |
|
void | EndScope () |
| Called when all allocations for the current scope have completed.
|
|
void | End () |
| Called when the allocations / deallocations have completed for all scopes.
|
|
const TransientAttachmentStatistics & | GetStatistics () const |
| Get statistics for the pool (built during End).
|
|
const TransientAttachmentPoolDescriptor & | GetDescriptor () const |
| Get pool descriptor.
|
|
TransientAttachmentPoolCompileFlags | GetCompileFlags () const |
| Get the compile flags being used during the allocation of resources.
|
|
| AZ_RTTI (DeviceObject, "{17D34F71-944C-4AF5-9823-627474C4C0A6}", Object) |
|
bool | IsInitialized () const |
| Returns whether the device object is initialized.
|
|
Device & | GetDevice () const |
|
| 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.
|
|
|
static bool | NeedsTransientAttachmentPool (const TransientAttachmentPoolDescriptor &descriptor) |
| Returns true if a Transient Attachment Pool is needed according to the supplied descriptor.
|
|
|
void | CollectHeapStats (AliasedResourceTypeFlags typeMask, AZStd::span< const TransientAttachmentStatistics::Heap > heapStats) |
|
void | Init (Device &device) |
| The derived class should call this method to assign the device.
|
|
void | Shutdown () override |
| Clears the current bound device to null.
|
|
void | add_ref () const |
|
void | release () const |
|
The transient attachment pool interface is used by the frame scheduler to compile the working set of transient attachments for the frame. Each scope is iterated topologically and transient resources are allocated and de-allocated. This is all done from within the compile phase. Therefore, an allocation may create a resource, but a de-allocation does not destroy resources! All de-allocation does is inform the pool that a resource can be re-used within a subsequent scope. The final result of this process is a set of image / buffer attachments that are backed by guaranteed memory valid only for the scope in which they attached.
◆ ActivateBuffer()
Called when an buffer is being activated for the first time. This class should acquire an buffer from the pool, configured for the provided descriptor. This may involve aliasing from a heap, or simple object pooling.
◆ ActivateImage()
Called when an image is being activated for the first time. This class should acquire an image from the pool, configured for the provided descriptor. This may involve aliasing from a heap, or simple object pooling.
◆ Begin()
void AZ::RHI::TransientAttachmentPool::Begin |
( |
const TransientAttachmentPoolCompileFlags |
flags = TransientAttachmentPoolCompileFlags::None , |
|
|
const TransientAttachmentStatistics::MemoryUsage * |
memoryHint = nullptr |
|
) |
| |
This is called at the beginning of the compile phase for the current frame, before any allocations occur. The user should clear the backing allocator to a fresh state.
◆ DeactivateBuffer()
virtual void AZ::RHI::TransientAttachmentPool::DeactivateBuffer |
( |
const AttachmentId & |
attachmentId | ) |
|
|
pure virtual |
Called when a buffer is being de-allocated from the pool. Called during the last scope the attachment is used, after all allocations for that scope have been processed.
◆ DeactivateImage()
virtual void AZ::RHI::TransientAttachmentPool::DeactivateImage |
( |
const AttachmentId & |
attachmentId | ) |
|
|
pure virtual |
Called when a image is being de-allocated from the pool. Called during the last scope the attachment is used, after all allocations for that scope have been processed.
◆ Shutdown()
void AZ::RHI::TransientAttachmentPool::Shutdown |
( |
| ) |
|
|
virtual |
The documentation for this class was generated from the following file:
- Gems/Atom/RHI/Code/Include/Atom/RHI/TransientAttachmentPool.h