ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface (#4739)
* 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>
This commit is contained in:
@@ -377,14 +377,7 @@ namespace AZ
|
||||
|
||||
bool ProfilingCaptureSystemComponent::CapturePassTimestamp(const AZStd::string& outputFilePath)
|
||||
{
|
||||
// Find the root pass.
|
||||
AZStd::vector<RPI::Pass*> passes = FindPasses({ "Root" });
|
||||
if (passes.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RPI::Pass* root = passes[0];
|
||||
RPI::Pass* root = AZ::RPI::PassSystemInterface::Get()->GetRootPass().get();
|
||||
|
||||
// Enable all the Timestamp queries in passes.
|
||||
root->SetTimestampQueryEnabled(true);
|
||||
@@ -465,14 +458,7 @@ namespace AZ
|
||||
|
||||
bool ProfilingCaptureSystemComponent::CapturePassPipelineStatistics(const AZStd::string& outputFilePath)
|
||||
{
|
||||
// Find the root pass.
|
||||
AZStd::vector<RPI::Pass*> passes = FindPasses({ "Root" });
|
||||
if (passes.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RPI::Pass* root = passes[0];
|
||||
RPI::Pass* root = AZ::RPI::PassSystemInterface::Get()->GetRootPass().get();
|
||||
|
||||
// Enable all the PipelineStatistics queries in passes.
|
||||
root->SetPipelineStatisticsQueryEnabled(true);
|
||||
@@ -572,19 +558,6 @@ namespace AZ
|
||||
return passes;
|
||||
}
|
||||
|
||||
AZStd::vector<RPI::Pass*> ProfilingCaptureSystemComponent::FindPasses(AZStd::vector<AZStd::string>&& passHierarchy) const
|
||||
{
|
||||
// Find the pass first.
|
||||
RPI::PassHierarchyFilter passFilter(passHierarchy);
|
||||
AZStd::vector<AZ::RPI::Pass*> foundPasses = AZ::RPI::PassSystemInterface::Get()->FindPasses(passFilter);
|
||||
if (foundPasses.size() == 0)
|
||||
{
|
||||
AZ_Warning("ProfilingCaptureSystemComponent", false, "Failed to find pass from %s", passFilter.ToString().c_str());
|
||||
}
|
||||
|
||||
return foundPasses;
|
||||
}
|
||||
|
||||
void ProfilingCaptureSystemComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] ScriptTimePoint time)
|
||||
{
|
||||
// Update the delayed captures
|
||||
|
||||
Reference in New Issue
Block a user