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 | Static Public Member Functions | Friends | List of all members
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, 0)
 
 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.
 
bool IsHotReloading () const override
 Returns whether the Pass System is currently hot reloading.
 
void SetHotReloading (bool hotReloading) override
 Sets whether the Pass System is currently hot reloading.
 
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 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)
 
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.
 

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

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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: