Hair - bug fix resulted from change in pass fetch using the new pipeline filter (#5013)

Signed-off-by: Adi-Amazon <Adi Bar-Lev barlev@amazon.com>

Co-authored-by: Adi-Amazon <Adi Bar-Lev barlev@amazon.com>
monroegm-disable-blank-issue-2
Adi Bar-Lev 4 years ago committed by GitHub
parent 856318005c
commit 707730ebbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -311,17 +311,17 @@ namespace AZ
m_forceClearRenderData = true; 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); RPI::Pass* pass = RPI::PassSystemInterface::Get()->FindFirstPass(passFilter);
return pass; return pass ? true : false;
} }
void HairFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr renderPipeline) void HairFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr renderPipeline)
{ {
// Proceed only if this is the main pipeline that contains the parent pass // Proceed only if this is the main pipeline that contains the parent pass
if (!HasHairParentPass()) if (!HasHairParentPass(renderPipeline.get()))
{ {
return; return;
} }
@ -335,7 +335,7 @@ namespace AZ
void HairFeatureProcessor::OnRenderPipelineRemoved([[maybe_unused]] RPI::RenderPipeline* renderPipeline) void HairFeatureProcessor::OnRenderPipelineRemoved([[maybe_unused]] RPI::RenderPipeline* renderPipeline)
{ {
// Proceed only if this is the main pipeline that contains the parent pass // Proceed only if this is the main pipeline that contains the parent pass
if (!HasHairParentPass()) if (!HasHairParentPass(renderPipeline))
{ {
return; return;
} }
@ -347,7 +347,7 @@ namespace AZ
void HairFeatureProcessor::OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) void HairFeatureProcessor::OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline)
{ {
// Proceed only if this is the main pipeline that contains the parent pass // Proceed only if this is the main pipeline that contains the parent pass
if (!HasHairParentPass()) if (!HasHairParentPass(renderPipeline))
{ {
return; return;
} }
@ -623,3 +623,4 @@ namespace AZ
} // namespace Hair } // namespace Hair
} // namespace Render } // namespace Render
} // namespace AZ } // namespace AZ

@ -165,7 +165,7 @@ namespace AZ
void EnablePasses(bool enable); void EnablePasses(bool enable);
bool HasHairParentPass(); bool HasHairParentPass(RPI::RenderPipeline* renderPipeline);
//! The following will serve to register the FP in the Thumbnail system //! The following will serve to register the FP in the Thumbnail system
AZStd::vector<AZStd::string> m_hairFeatureProcessorRegistryName; AZStd::vector<AZStd::string> m_hairFeatureProcessorRegistryName;

Loading…
Cancel
Save