Hair - bug fix of changing the method by which passes are acquired (#5015)

Signed-off-by: Adi-Amazon <barlev@amazon.com>
Signed-off-by: Adi-Amazon <82479970+Adi-Amazon@users.noreply.github.com>

Co-authored-by: Adi-Amazon <barlev@amazon.com>
This commit is contained in:
Adi Bar-Lev
2021-10-27 09:30:24 -04:00
committed by GitHub
parent af7bb2332f
commit 0e4e84eb73
2 changed files with 8 additions and 7 deletions
@@ -311,17 +311,17 @@ namespace AZ
m_forceClearRenderData = true;
}
bool HairFeatureProcessor::HasHairParentPass()
bool HairFeatureProcessor::HasHairParentPass(RPI::RenderPipeline* renderPipeline)
{
RPI::PassFilter passFilter = RPI::PassFilter::CreateWithPassName(HairParentPassName, GetParentScene());
RPI::PassFilter passFilter = RPI::PassFilter::CreateWithPassName(HairParentPassName, renderPipeline);
RPI::Pass* pass = RPI::PassSystemInterface::Get()->FindFirstPass(passFilter);
return pass;
return pass ? true : false;
}
void HairFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr renderPipeline)
{
// Proceed only if this is the main pipeline that contains the parent pass
if (!HasHairParentPass())
if (!HasHairParentPass(renderPipeline.get()))
{
return;
}
@@ -335,7 +335,7 @@ namespace AZ
void HairFeatureProcessor::OnRenderPipelineRemoved([[maybe_unused]] RPI::RenderPipeline* renderPipeline)
{
// Proceed only if this is the main pipeline that contains the parent pass
if (!HasHairParentPass())
if (!HasHairParentPass(renderPipeline))
{
return;
}
@@ -347,7 +347,7 @@ namespace AZ
void HairFeatureProcessor::OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline)
{
// Proceed only if this is the main pipeline that contains the parent pass
if (!HasHairParentPass())
if (!HasHairParentPass(renderPipeline))
{
return;
}
@@ -623,3 +623,4 @@ namespace AZ
} // namespace Hair
} // namespace Render
} // namespace AZ
@@ -165,7 +165,7 @@ namespace AZ
void EnablePasses(bool enable);
bool HasHairParentPass();
bool HasHairParentPass(RPI::RenderPipeline* renderPipeline);
//! The following will serve to register the FP in the Thumbnail system
AZStd::vector<AZStd::string> m_hairFeatureProcessorRegistryName;