ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface (#4739) (#4963)
* ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface
Introduced new PassSystemInterface::ForEachPass() funtion to replace PassSystemInterface::FindPasses(), PassSystemInterface::GetPassesByTemplateName and ParentPass::FindPassByNameRecursive() functions.
Update all the places which were using those three functions.
The new pass finding filter support any combination of pass name, pass template name, pass class type, pass hirechary, owner scene, owner render pipeline.
Update unit tests.
Signed-off-by: Qing Tao <qingtao@amazon.com>
(cherry picked from commit fe8dac7989)
This commit is contained in:
@@ -456,11 +456,6 @@ namespace AZ
|
||||
return m_passLibrary.HasPassesForTemplate(templateName);
|
||||
}
|
||||
|
||||
const AZStd::vector<Pass*>& PassSystem::GetPassesForTemplateName(const Name& templateName) const
|
||||
{
|
||||
return m_passLibrary.GetPassesForTemplate(templateName);
|
||||
}
|
||||
|
||||
bool PassSystem::AddPassTemplate(const Name& name, const AZStd::shared_ptr<PassTemplate>& passTemplate)
|
||||
{
|
||||
return m_passLibrary.AddPassTemplate(name, passTemplate);
|
||||
@@ -487,10 +482,21 @@ namespace AZ
|
||||
RemovePassFromLibrary(pass);
|
||||
--m_passCounter;
|
||||
}
|
||||
|
||||
AZStd::vector<Pass*> PassSystem::FindPasses(const PassFilter& passFilter) const
|
||||
|
||||
void PassSystem::ForEachPass(const PassFilter& filter, AZStd::function<PassFilterExecutionFlow(Pass*)> passFunction)
|
||||
{
|
||||
return m_passLibrary.FindPasses(passFilter);
|
||||
return m_passLibrary.ForEachPass(filter, passFunction);
|
||||
}
|
||||
|
||||
Pass* PassSystem::FindFirstPass(const PassFilter& filter)
|
||||
{
|
||||
Pass* foundPass = nullptr;
|
||||
m_passLibrary.ForEachPass(filter, [&foundPass](RPI::Pass* pass) ->PassFilterExecutionFlow
|
||||
{
|
||||
foundPass = pass;
|
||||
return PassFilterExecutionFlow::StopVisitingPasses;
|
||||
});
|
||||
return foundPass;
|
||||
}
|
||||
|
||||
SwapChainPass* PassSystem::FindSwapChainPass(AzFramework::NativeWindowHandle windowHandle) const
|
||||
|
||||
Reference in New Issue
Block a user