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::RPI::PassSystem Class Referencefinal

#include <PassSystem.h>

Inherits AZ::RPI::PassSystemInterface.

Public Member Functions

 AZ_RTTI (PassSystem, "{6AA45529-53CF-4AEF-86DF-A696C760105B}", PassSystemInterface)
 
 AZ_CLASS_ALLOCATOR (PassSystem, AZ::SystemAllocator)
 
 AZ_DISABLE_COPY_MOVE (PassSystem)
 
void Init ()
 Initializes the PassSystem and the Root Pass and creates the Pass InstanceDatabase.
 
void InitPassTemplates ()
 
void Shutdown ()
 Deletes the Root Pass and shuts down the PassSystem.
 
void FrameUpdate (RHI::FrameGraphBuilder &frameGraphBuilder)
 Called every frame, essentially the 'OnTick' of the pass system.
 
void FrameEnd ()
 Called after the frame has been rendered. Allows passes to execute post frame logic.
 
void ProcessQueuedChanges () override
 
bool LoadPassTemplateMappings (const AZStd::string &templateMappingPath) override
 
void WriteTemplateToFile (const PassTemplate &passTemplate, AZStd::string_view assetFilePath) override
 
void DebugPrintPassHierarchy () override
 Prints the entire pass hierarchy from the root.
 
void SetTargetedPassDebuggingName (const AZ::Name &targetPassName) override
 
const AZ::Name & GetTargetedPassDebuggingName () const override
 
void ConnectEvent (OnReadyLoadTemplatesEvent::Handler &handler) override
 
PassSystemState GetState () const override
 
SwapChainPassFindSwapChainPass (AzFramework::NativeWindowHandle windowHandle) const override
 Find the SwapChainPass associated with window Handle.
 
void DebugBreakOnPass (const Pass *pass) const override
 
void AddRenderPipeline (RenderPipeline *renderPipeline) override
 Registers a render pipeline with the pass system.
 
void RemoveRenderPipeline (RenderPipeline *renderPipeline) override
 Removes a render pipeline from the pass system.
 
void AddPassWithoutPipeline (const Ptr< Pass > &pass) override
 Used to add passes that do not belong to any render pipeline.
 
void IncrementFrameDrawItemCount (u32 numDrawItems) override
 
void IncrementFrameRenderPassCount () override
 
PassSystemFrameStatistics GetFrameStatistics () override
 
void AddPassCreator (Name className, PassCreator createFunction) override
 Registers a PassCreator with the PassFactory.
 
Ptr< PassCreatePassFromClass (Name passClassName, Name passName) override
 Creates a Pass using the name of the Pass class.
 
Ptr< PassCreatePassFromTemplate (const AZStd::shared_ptr< const PassTemplate > &passTemplate, Name passName) override
 Creates a Pass using a PassTemplate.
 
Ptr< PassCreatePassFromTemplate (Name templateName, Name passName) override
 Creates a Pass using the name of a PassTemplate.
 
Ptr< PassCreatePassFromRequest (const PassRequest *passRequest) override
 Creates a Pass using a PassRequest.
 
bool HasCreatorForClass (Name passClassName) override
 Returns true if the factory has a creator for a given pass class name.
 
bool HasTemplate (const Name &templateName) const override
 Returns true if the pass library contains a pass template with the given template name.
 
bool HasPassesForTemplateName (const Name &templateName) const override
 Returns true if the pass factory contains passes created with the given template name.
 
bool AddPassTemplate (const Name &name, const AZStd::shared_ptr< PassTemplate > &passTemplate) override
 Adds a PassTemplate to the library.
 
const AZStd::shared_ptr< const PassTemplateGetPassTemplate (const Name &name) const override
 Retrieves a PassTemplate from the library.
 
void RemovePassTemplate (const Name &name) override
 See remarks in PassLibrary.h for the function with this name.
 
void RemovePassFromLibrary (Pass *pass) override
 Removes all references to the given pass from the pass library.
 
void RegisterPass (Pass *pass) override
 Registers the pass with the pass library. Called in the Pass constructor.
 
void UnregisterPass (Pass *pass) override
 Unregisters the pass with the pass library. Called in the Pass destructor.
 
void ForEachPass (const PassFilter &filter, AZStd::function< PassFilterExecutionFlow(Pass *)> passFunction) override
 
PassFindFirstPass (const PassFilter &filter) override
 
- Public Member Functions inherited from AZ::RPI::PassSystemInterface
 AZ_RTTI (PassSystemInterface, "{19DE806F-F1B2-4B1E-A0F2-F8BA85B4552E}")
 
 AZ_DISABLE_COPY_MOVE (PassSystemInterface)
 
virtual const Ptr< ParentPass > & GetRootPass ()=0
 Returns the root of the pass hierarchy.
 
virtual void AddRenderPipeline (RenderPipeline *renderPipeline)=0
 Registers a render pipeline with the pass system.
 
virtual void RemoveRenderPipeline (RenderPipeline *renderPipeline)=0
 Removes a render pipeline from the pass system.
 
virtual void AddPassWithoutPipeline (const Ptr< Pass > &pass)=0
 Used to add passes that do not belong to any render pipeline.
 
virtual void ProcessQueuedChanges ()=0
 
virtual bool LoadPassTemplateMappings (const AZStd::string &templateMappingPath)=0
 
virtual void WriteTemplateToFile (const PassTemplate &passTemplate, AZStd::string_view assetFilePath)=0
 
virtual void DebugPrintPassHierarchy ()=0
 Prints the entire pass hierarchy from the root.
 
virtual void SetTargetedPassDebuggingName (const AZ::Name &targetPassName)=0
 
virtual const AZ::Name & GetTargetedPassDebuggingName () const =0
 
virtual SwapChainPassFindSwapChainPass (AzFramework::NativeWindowHandle windowHandle) const =0
 Find the SwapChainPass associated with window Handle.
 
virtual void ConnectEvent (OnReadyLoadTemplatesEvent::Handler &handler)=0
 
virtual PassSystemState GetState () const =0
 
virtual void IncrementFrameDrawItemCount (u32 numDrawItems)=0
 
virtual void IncrementFrameRenderPassCount ()=0
 
virtual PassSystemFrameStatistics GetFrameStatistics ()=0
 
virtual void DebugBreakOnPass (const Pass *pass) const =0
 
template<typename PassType >
Ptr< PassType > CreatePass (const PassDescriptor &descriptor)
 Directly creates a pass given a PassDescriptor.
 
template<typename PassType >
Ptr< PassType > CreatePass (Name name)
 Directly creates a pass given a Name.
 
virtual void AddPassCreator (Name className, PassCreator createFunction)=0
 Registers a PassCreator with the PassFactory.
 
virtual Ptr< PassCreatePassFromClass (Name passClassName, Name passName)=0
 Creates a Pass using the name of the Pass class.
 
virtual Ptr< PassCreatePassFromTemplate (const AZStd::shared_ptr< const PassTemplate > &passTemplate, Name passName)=0
 Creates a Pass using a PassTemplate.
 
virtual Ptr< PassCreatePassFromTemplate (Name templateName, Name passName)=0
 Creates a Pass using the name of a PassTemplate.
 
virtual Ptr< PassCreatePassFromRequest (const PassRequest *passRequest)=0
 Creates a Pass using a PassRequest.
 
virtual bool HasCreatorForClass (Name passClassName)=0
 Returns true if the factory has a creator for a given pass class name.
 
virtual bool HasTemplate (const Name &templateName) const =0
 Returns true if the pass library contains a pass template with the given template name.
 
virtual bool HasPassesForTemplateName (const Name &templateName) const =0
 Returns true if the pass factory contains passes created with the given template name.
 
virtual bool AddPassTemplate (const Name &name, const AZStd::shared_ptr< PassTemplate > &passTemplate)=0
 Adds a PassTemplate to the library.
 
virtual const AZStd::shared_ptr< const PassTemplateGetPassTemplate (const Name &name) const =0
 Retrieves a PassTemplate from the library.
 
virtual void RemovePassTemplate (const Name &name)=0
 See remarks in PassLibrary.h for the function with this name.
 
virtual void RemovePassFromLibrary (Pass *pass)=0
 Removes all references to the given pass from the pass library.
 
virtual void ForEachPass (const PassFilter &filter, AZStd::function< PassFilterExecutionFlow(Pass *)> passFunction)=0
 
virtual PassFindFirstPass (const PassFilter &filter)=0
 

Static Public Member Functions

static void Reflect (ReflectContext *context)
 
static void GetAssetHandlers (AssetHandlerPtrList &assetHandlers)
 
- Static Public Member Functions inherited from AZ::RPI::PassSystemInterface
static PassSystemInterfaceGet ()
 

Friends

class PassTests
 

Additional Inherited Members

- Public Types inherited from AZ::RPI::PassSystemInterface
using OnReadyLoadTemplatesEvent = AZ::Event<>
 

Detailed Description

The central class of the pass system. Responsible for preparing the frame and keeping track of which passes need rebuilding or deleting. Holds the root of the pass hierarchy.

Member Function Documentation

◆ AddPassCreator()

void AZ::RPI::PassSystem::AddPassCreator ( Name  className,
PassCreator  createFunction 
)
overridevirtual

Registers a PassCreator with the PassFactory.

Implements AZ::RPI::PassSystemInterface.

◆ AddPassTemplate()

bool AZ::RPI::PassSystem::AddPassTemplate ( const Name &  name,
const AZStd::shared_ptr< PassTemplate > &  passTemplate 
)
overridevirtual

Adds a PassTemplate to the library.

Implements AZ::RPI::PassSystemInterface.

◆ AddPassWithoutPipeline()

void AZ::RPI::PassSystem::AddPassWithoutPipeline ( const Ptr< Pass > &  pass)
overridevirtual

Used to add passes that do not belong to any render pipeline.

Implements AZ::RPI::PassSystemInterface.

◆ AddRenderPipeline()

void AZ::RPI::PassSystem::AddRenderPipeline ( RenderPipeline renderPipeline)
overridevirtual

Registers a render pipeline with the pass system.

Implements AZ::RPI::PassSystemInterface.

◆ ConnectEvent()

void AZ::RPI::PassSystem::ConnectEvent ( OnReadyLoadTemplatesEvent::Handler &  handler)
overridevirtual

Connect a handler to listen to the event that the pass system is ready to load pass templates The event is triggered when pass system is initialized and asset system is ready. The handler can add new pass templates or load pass template mappings from assets

Implements AZ::RPI::PassSystemInterface.

◆ CreatePassFromClass()

Ptr< Pass > AZ::RPI::PassSystem::CreatePassFromClass ( Name  passClassName,
Name  passName 
)
overridevirtual

Creates a Pass using the name of the Pass class.

Implements AZ::RPI::PassSystemInterface.

◆ CreatePassFromRequest()

Ptr< Pass > AZ::RPI::PassSystem::CreatePassFromRequest ( const PassRequest passRequest)
overridevirtual

Creates a Pass using a PassRequest.

Implements AZ::RPI::PassSystemInterface.

◆ CreatePassFromTemplate() [1/2]

Ptr< Pass > AZ::RPI::PassSystem::CreatePassFromTemplate ( const AZStd::shared_ptr< const PassTemplate > &  passTemplate,
Name  passName 
)
overridevirtual

Creates a Pass using a PassTemplate.

Implements AZ::RPI::PassSystemInterface.

◆ CreatePassFromTemplate() [2/2]

Ptr< Pass > AZ::RPI::PassSystem::CreatePassFromTemplate ( Name  templateName,
Name  passName 
)
overridevirtual

Creates a Pass using the name of a PassTemplate.

Implements AZ::RPI::PassSystemInterface.

◆ DebugBreakOnPass()

void AZ::RPI::PassSystem::DebugBreakOnPass ( const Pass pass) const
overridevirtual

◆ DebugPrintPassHierarchy()

void AZ::RPI::PassSystem::DebugPrintPassHierarchy ( )
overridevirtual

Prints the entire pass hierarchy from the root.

Implements AZ::RPI::PassSystemInterface.

◆ FindFirstPass()

Pass * AZ::RPI::PassSystem::FindFirstPass ( const PassFilter filter)
overridevirtual

Find the first matching pass from registered passes with specified filter Note: this function SHOULD ONLY be used when you are certain you only need to handle the first pass found

Implements AZ::RPI::PassSystemInterface.

◆ FindSwapChainPass()

SwapChainPass * AZ::RPI::PassSystem::FindSwapChainPass ( AzFramework::NativeWindowHandle  windowHandle) const
overridevirtual

Find the SwapChainPass associated with window Handle.

Implements AZ::RPI::PassSystemInterface.

◆ ForEachPass()

void AZ::RPI::PassSystem::ForEachPass ( const PassFilter filter,
AZStd::function< PassFilterExecutionFlow(Pass *)>  passFunction 
)
overridevirtual

Visit the matching passes from registered passes with specified filter The return value of the passFunction decides if the search continues or not Note: this function will find all the passes which match the pass filter even they are for render pipelines which are not added to a scene This function is fast if a pass name or a pass template name is specified.

Implements AZ::RPI::PassSystemInterface.

◆ GetFrameStatistics()

PassSystemFrameStatistics AZ::RPI::PassSystem::GetFrameStatistics ( )
overridevirtual

◆ GetPassTemplate()

const AZStd::shared_ptr< const PassTemplate > AZ::RPI::PassSystem::GetPassTemplate ( const Name &  name) const
overridevirtual

Retrieves a PassTemplate from the library.

Implements AZ::RPI::PassSystemInterface.

◆ GetState()

PassSystemState AZ::RPI::PassSystem::GetState ( ) const
overridevirtual

◆ GetTargetedPassDebuggingName()

const AZ::Name & AZ::RPI::PassSystem::GetTargetedPassDebuggingName ( ) const
overridevirtual

◆ HasCreatorForClass()

bool AZ::RPI::PassSystem::HasCreatorForClass ( Name  passClassName)
overridevirtual

Returns true if the factory has a creator for a given pass class name.

Implements AZ::RPI::PassSystemInterface.

◆ HasPassesForTemplateName()

bool AZ::RPI::PassSystem::HasPassesForTemplateName ( const Name &  templateName) const
overridevirtual

Returns true if the pass factory contains passes created with the given template name.

Implements AZ::RPI::PassSystemInterface.

◆ HasTemplate()

bool AZ::RPI::PassSystem::HasTemplate ( const Name &  templateName) const
overridevirtual

Returns true if the pass library contains a pass template with the given template name.

Implements AZ::RPI::PassSystemInterface.

◆ IncrementFrameDrawItemCount()

void AZ::RPI::PassSystem::IncrementFrameDrawItemCount ( u32  numDrawItems)
overridevirtual

◆ IncrementFrameRenderPassCount()

void AZ::RPI::PassSystem::IncrementFrameRenderPassCount ( )
overridevirtual

◆ InitPassTemplates()

void AZ::RPI::PassSystem::InitPassTemplates ( )

Initialize and load pass templates This function need to be called after Init()

◆ LoadPassTemplateMappings()

bool AZ::RPI::PassSystem::LoadPassTemplateMappings ( const AZStd::string &  templateMappingPath)
overridevirtual

Load pass templates listed in a name-assetid mapping asset This function should be called before the render pipelines which use templates from this mappings are created. To load pass template mapping before any render pipelines are created, use OnReadyLoadTemplatesEvent::Handler to load desired pass template mappings

Implements AZ::RPI::PassSystemInterface.

◆ ProcessQueuedChanges()

void AZ::RPI::PassSystem::ProcessQueuedChanges ( )
overridevirtual

Processes pass tree changes that were queued by QueueFor*() functions. This is called automatically in FrameUpdate(), but may be called manually when needed, like when initializing a scene;

Implements AZ::RPI::PassSystemInterface.

◆ RegisterPass()

void AZ::RPI::PassSystem::RegisterPass ( Pass pass)
overridevirtual

Registers the pass with the pass library. Called in the Pass constructor.

Implements AZ::RPI::PassSystemInterface.

◆ RemovePassFromLibrary()

void AZ::RPI::PassSystem::RemovePassFromLibrary ( Pass pass)
overridevirtual

Removes all references to the given pass from the pass library.

Implements AZ::RPI::PassSystemInterface.

◆ RemovePassTemplate()

void AZ::RPI::PassSystem::RemovePassTemplate ( const Name &  name)
overridevirtual

See remarks in PassLibrary.h for the function with this name.

Implements AZ::RPI::PassSystemInterface.

◆ RemoveRenderPipeline()

void AZ::RPI::PassSystem::RemoveRenderPipeline ( RenderPipeline renderPipeline)
overridevirtual

Removes a render pipeline from the pass system.

Implements AZ::RPI::PassSystemInterface.

◆ SetTargetedPassDebuggingName()

void AZ::RPI::PassSystem::SetTargetedPassDebuggingName ( const AZ::Name &  targetPassName)
overridevirtual

The pass system enables targeted debugging of a specific pass given the name of the pass These are the setters and getters for the specific Pass's name To break in your pass code for a specified pass name, use the macro below

Implements AZ::RPI::PassSystemInterface.

◆ UnregisterPass()

void AZ::RPI::PassSystem::UnregisterPass ( Pass pass)
overridevirtual

Unregisters the pass with the pass library. Called in the Pass destructor.

Implements AZ::RPI::PassSystemInterface.

◆ WriteTemplateToFile()

void AZ::RPI::PassSystem::WriteTemplateToFile ( const PassTemplate passTemplate,
AZStd::string_view  assetFilePath 
)
overridevirtual

Writes a pass template to a .pass file which can then be used as a pass asset. Useful for quickly authoring a pass template in code and then outputting it as a pass asset using JSON

Implements AZ::RPI::PassSystemInterface.


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