Open 3D Engine Atom Gem API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | List of all members
AZ::RHI::FrameGraphInterface Class Reference

#include <FrameGraphInterface.h>

Public Member Functions

 FrameGraphInterface (FrameGraph &frameGraph)
 
FrameGraphAttachmentInterface GetAttachmentDatabase ()
 Acquires the attachment builder interface for declaring new attachments.
 
ResultCode UseAttachment (const BufferScopeAttachmentDescriptor &descriptor, ScopeAttachmentAccess access, ScopeAttachmentUsage usage)
 Declares a buffer attachment for use on the current scope.
 
ResultCode UseAttachment (const ImageScopeAttachmentDescriptor &descriptor, ScopeAttachmentAccess access, ScopeAttachmentUsage usage)
 Declares an image attachment for use on the current scope.
 
ResultCode UseAttachments (AZStd::span< const ImageScopeAttachmentDescriptor > descriptors, ScopeAttachmentAccess access, ScopeAttachmentUsage usage)
 Declares an array of image attachments for use on the current scope.
 
ResultCode UseColorAttachments (AZStd::span< const ImageScopeAttachmentDescriptor > descriptors)
 Declares an array of color attachments for use on the current scope.
 
ResultCode UseColorAttachment (const ImageScopeAttachmentDescriptor &descriptor)
 Declares a single color attachment for use on the current scope.
 
ResultCode UseSubpassInputAttachments (AZStd::span< const ImageScopeAttachmentDescriptor > descriptors)
 
ResultCode UseSubpassInputAttachment (const ImageScopeAttachmentDescriptor &descriptor)
 
ResultCode UseResolveAttachment (const ResolveScopeAttachmentDescriptor &descriptor)
 Declares a single resolve attachment for use on the current scope.
 
ResultCode UseDepthStencilAttachment (const ImageScopeAttachmentDescriptor &descriptor, ScopeAttachmentAccess access)
 
ResultCode UseShaderAttachment (const BufferScopeAttachmentDescriptor &descriptor, ScopeAttachmentAccess access)
 
ResultCode UseShaderAttachment (const ImageScopeAttachmentDescriptor &descriptor, ScopeAttachmentAccess access)
 
ResultCode UseCopyAttachment (const BufferScopeAttachmentDescriptor &descriptor, ScopeAttachmentAccess access)
 
ResultCode UseCopyAttachment (const ImageScopeAttachmentDescriptor &descriptor, ScopeAttachmentAccess access)
 
ResultCode UseInputAssemblyAttachment (const BufferScopeAttachmentDescriptor &descriptor)
 
ResultCode UseQueryPool (Ptr< QueryPool > queryPool, const RHI::Interval &interval, QueryPoolScopeAttachmentType type, ScopeAttachmentAccess access)
 
void ExecuteAfter (const ScopeId &producerScopeId)
 Declares that this scope depends on the given scope id, and must wait for it to complete.
 
void ExecuteBefore (const ScopeId &consumerScopeId)
 
void SignalFence (Fence &fence)
 Requests that the provided fence be signaled after the scope has completed.
 
void SetEstimatedItemCount (uint32_t itemCount)
 
void SetHardwareQueueClass (HardwareQueueClass hardwareQueueClass)
 Requests that a specific GPU hardware queue be used for processing this scope.
 

Detailed Description

This interface exposes FrameGraph functionality to non-RHI systems (like the RPI). This is in order to reduce access to certain public functions in FrameGraph that are intended for RHI use only. FrameGraph is a class that builds and orders scopes (associated with a specific scope id) for the current frame. This interface is broken down into two parts: global attachment registration and local scope configuration.

Attachments are resources registered with the frame scheduler. Persistent resources are "imported" into the frame scheduler directly. Transient resources are created and internally managed by the frame scheduler. Their lifetime is only valid for the scopes that use them.

Global attachment registration is done through this API via the create / import methods. Those operations are considered immediate and global. This means any scopes built later can reference the attachment id. This is useful if a downstream scope just wants to use an attachment without caring where it came from.

Local scope configuration is done via the Use* and other remaining methods. A scope must declare usage of an attachment via Use*. This is true even if the scope created or imported the attachment.

Member Function Documentation

◆ ExecuteBefore()

void AZ::RHI::FrameGraphInterface::ExecuteBefore ( const ScopeId &  consumerScopeId)
inline

Declares that the given scope at

Parameters
consumerScopeIddepends on this scope, forcing this scope to execute first.

◆ SetEstimatedItemCount()

void AZ::RHI::FrameGraphInterface::SetEstimatedItemCount ( uint32_t  itemCount)
inline

Sets the number of work items (Draw / Dispatch / etc) that will be processed by this scope. This value is used to load-balance the scope across command lists. A small value may result in the scope being merged onto a single command list, whereas a large one may result in the scope being split across several command lists in order to best parallelize submission

◆ UseCopyAttachment() [1/2]

ResultCode AZ::RHI::FrameGraphInterface::UseCopyAttachment ( const BufferScopeAttachmentDescriptor descriptor,
ScopeAttachmentAccess  access 
)
inline

Declares a buffer copy attachment for use on the current scope.

Parameters
descriptorThe buffer scope attachment.
accessHow the attachment is accessed by the scope. Must be read-write if a clear action is specified.

◆ UseCopyAttachment() [2/2]

ResultCode AZ::RHI::FrameGraphInterface::UseCopyAttachment ( const ImageScopeAttachmentDescriptor descriptor,
ScopeAttachmentAccess  access 
)
inline

Declares an image copy attachment for use on the current scope.

Parameters
descriptorThe image scope attachment.
accessHow the attachment is accessed by the scope. Must be read-write if a clear action is specified.

◆ UseDepthStencilAttachment()

ResultCode AZ::RHI::FrameGraphInterface::UseDepthStencilAttachment ( const ImageScopeAttachmentDescriptor descriptor,
ScopeAttachmentAccess  access 
)
inline

Declares a depth-stencil attachment for use on the current scope.

Parameters
descriptorThe depth stencil scope attachment.
accessHow the attachment is accessed by the scope. Must be read-write if a clear action is specified.

◆ UseInputAssemblyAttachment()

ResultCode AZ::RHI::FrameGraphInterface::UseInputAssemblyAttachment ( const BufferScopeAttachmentDescriptor descriptor)
inline

Declares a buffer input assembly attachment for use on the current scope.

Parameters
descriptorThe buffer scope attachment.

◆ UseQueryPool()

ResultCode AZ::RHI::FrameGraphInterface::UseQueryPool ( Ptr< QueryPool queryPool,
const RHI::Interval interval,
QueryPoolScopeAttachmentType  type,
ScopeAttachmentAccess  access 
)
inline

Declares a query pool for use on the current scope.

Parameters
queryPoolThe query pool to be used.
intervalThe range of queries from the pool that will be use by the current scope.
typeThe type of query pool attachment.
accessHow the attachment is accessed by the scope.

◆ UseShaderAttachment() [1/2]

ResultCode AZ::RHI::FrameGraphInterface::UseShaderAttachment ( const BufferScopeAttachmentDescriptor descriptor,
ScopeAttachmentAccess  access 
)
inline

Declares a buffer shader attachment for use on the current scope.

Parameters
descriptorThe buffer scope attachment.
accessHow the attachment is accessed by the scope. Must be read-write if a clear action is specified.

◆ UseShaderAttachment() [2/2]

ResultCode AZ::RHI::FrameGraphInterface::UseShaderAttachment ( const ImageScopeAttachmentDescriptor descriptor,
ScopeAttachmentAccess  access 
)
inline

Declares an image shader attachment for use on the current scope.

Parameters
descriptorThe image scope attachment.
accessHow the attachment is accessed by the scope. Must be read-write if a clear action is specified.

◆ UseSubpassInputAttachment()

ResultCode AZ::RHI::FrameGraphInterface::UseSubpassInputAttachment ( const ImageScopeAttachmentDescriptor descriptor)
inline

Declares a single subpass input attachment for use on the current scope. Subpass input attachments are image views that can be used for pixel local load operations inside a fragment shader. This means that framebuffer attachments written in one subpass can be read from at the exact same pixel in subsequent subpasses. Certain platform have optimization for this type of attachments.

◆ UseSubpassInputAttachments()

ResultCode AZ::RHI::FrameGraphInterface::UseSubpassInputAttachments ( AZStd::span< const ImageScopeAttachmentDescriptor descriptors)
inline

Declares an array of subpass input attachments for use on the current scope. See UseSubpassInputAttachment for a definition about a SubpassInput.


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