#include <PassLibrary.h>
Inherits AZ::Data::AssetBus::MultiHandler.
Classes | |
struct | TemplateEntry |
Public Types | |
typedef AZStd::unordered_map< Name, TemplateEntry > | TemplateEntriesByName |
Public Member Functions | |
void | Init () |
void | Shutdown () |
bool | AddPassTemplate (const Name &name, const AZStd::shared_ptr< PassTemplate > &passTemplate, bool hotReloading=false) |
Register a Pass/PassTemplate with the library. | |
void | AddPass (Pass *pass) |
bool | HasTemplate (const Name &templateName) const |
Returns whether the library has a template/passes associated with a template given a template name. | |
bool | HasPassesForTemplate (const Name &templateName) const |
const AZStd::shared_ptr< const PassTemplate > | GetPassTemplate (const Name &name) const |
Retrieves a PassTemplate from the library. | |
const AZStd::vector< Pass * > & | GetPassesForTemplate (const Name &templateName) const |
Returns a list of passes using the template with the name passed as argument. | |
void | RemovePassTemplate (const Name &name) |
void | RemovePassFromLibrary (Pass *pass) |
Removes a pass from both it's associated template (if it has one) and from the pass name mapping. | |
bool | LoadPassTemplateMappings (const AZStd::string &templateMappingPath) |
Load pass templates which are list in an AssetAliases. | |
bool | LoadPassTemplateMappings (Data::Asset< AnyAsset > mappingAsset) |
void | ForEachPass (const PassFilter &passFilter, AZStd::function< PassFilterExecutionFlow(Pass *)> passFunction) |
Visit each pass which matches the filter. | |
Library used to keep track of passes and pass template. Responsible for Storing all PassTemplates Storing all PassAssets Storing references to all Passes Retrieving a PassTemplate given it's Name Retrieving all passes given a PassTemplate Retrieving all passes with a given Name Retrieving all passes with a given PassFilter
Because PassLibrary enables PassTemplates to be referenced with just a Name, this enables code to reference Passes defined in data and vice-versa
void AZ::RPI::PassLibrary::RemovePassTemplate | ( | const Name & | name | ) |
Removes a PassTemplate by name, only if the following two conditions are met: 1- The template was NOT created from an Asset. This means the template will be erasable only if it was created at runtime with C++. 2- The are no instantiated Passes referencing such template. If the template exists but both conditions are not met then the function will assert. If a template with the given name doesn't exist the function does nothing. This function should be used judiciously, and under rare circumstances. For example, Applications that iteratively create and need to delete templates at runtime.