Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RHI::FrameGraphAttachmentInterface Class Reference

#include <FrameGraphAttachmentInterface.h>

Public Member Functions

 FrameGraphAttachmentInterface (FrameGraphAttachmentDatabase &attachmentDatabase)
 
ResultCode ImportImage (const AttachmentId &attachmentId, Ptr< Image > image)
 
ResultCode ImportSwapChain (const AttachmentId &attachmentId, Ptr< SwapChain > swapChain)
 
ResultCode ImportBuffer (const AttachmentId &attachmentId, Ptr< Buffer > buffer)
 
ResultCode CreateTransientImage (const TransientImageDescriptor &descriptor)
 Creates a transient image as an attachment. The provided attachment id is associated with the new attachment.
 
ResultCode CreateTransientBuffer (const TransientBufferDescriptor &descriptor)
 Creates a transient buffer as an attachment. The provided attachment id is associated with the new attachment.
 
bool IsAttachmentValid (const AttachmentId &attachmentId) const
 Returns whether the attachment id was registered via a call to Create / Import.
 
const FrameAttachmentFindAttachment (const AttachmentId &attachmentId) const
 Returns the FrameAttachment for a given AttachmentId, or nullptr if not found.
 
ImageDescriptor GetImageDescriptor (const AttachmentId &attachmentId)
 
BufferDescriptor GetBufferDescriptor (const AttachmentId &attachmentId) const
 

Detailed Description

This interface exposes FrameGraphAttachmentDatabase functionality to non-RHI systems (like the RPI). This is in order to reduce access to certain public functions in FrameGraphAttachmentDatabase that are intended for RHI use only.

Attachment registration for a particular AttachmentId occurs just once per frame. A registration event makes the attachment immediately visible via the AttachmentId. Any "Use" operation after this call, either on this scope or a downstream scope, may reference that attachment by AttachmentId.

Attachments fall into two categories:

(Imports): Persistent attachments owned by the user are imported into the frame scheduler each frame. The frame scheduler merely references the attachment; it does not dictate ownership.

(Transients): Transient Attachments are owned and managed by the frame scheduler. They persist only for the current frame. The user references the transient attachment by AttachmentId, and is able to access resource contents in the Compile and Execute phases of a ScopeProducer (via the respective phase contexts).

Member Function Documentation

◆ GetBufferDescriptor()

BufferDescriptor AZ::RHI::FrameGraphAttachmentInterface::GetBufferDescriptor ( const AttachmentId &  attachmentId) const
inline

Resolves an attachment id to an image descriptor. This is useful when accessing image information for an attachment that was declared in a different scope.

Parameters
attachmentIdThe attachment id used to lookup the descriptors.

◆ GetImageDescriptor()

ImageDescriptor AZ::RHI::FrameGraphAttachmentInterface::GetImageDescriptor ( const AttachmentId &  attachmentId)
inline

Resolves an attachment id to a buffer descriptor. This is useful when accessing buffer information for an attachment that was declared in a different scope.

Parameters
attachmentIdThe attachment id used to lookup the descriptors.

◆ ImportBuffer()

ResultCode AZ::RHI::FrameGraphAttachmentInterface::ImportBuffer ( const AttachmentId &  attachmentId,
Ptr< Buffer buffer 
)
inline

Imports a persistent buffer as an attachment.

Parameters
bufferAttachmentThe buffer attachment to import.

◆ ImportImage()

ResultCode AZ::RHI::FrameGraphAttachmentInterface::ImportImage ( const AttachmentId &  attachmentId,
Ptr< Image image 
)
inline

Imports a persistent image as an attachment.

Parameters
imageAttachmentThe image attachment to import.

◆ ImportSwapChain()

ResultCode AZ::RHI::FrameGraphAttachmentInterface::ImportSwapChain ( const AttachmentId &  attachmentId,
Ptr< SwapChain swapChain 
)
inline

Imports a swap chain image as an attachment.

Parameters
swapChainAttachmentThe swap chain attachment to import.

The documentation for this class was generated from the following file: