Hair and Tools Pipeline bug fixes (#4902)

- Fixed fallback connections for hair pipeline to allow disabling the parent pass hierarchy when not required
- Renamed the Thumbnail pipeline to be used as generic minimal tools pipeline
- Reused the Tools pipeline for the preview renderer - minimal FPs and passes

Remark:
- The tools pipeline should have folloup submits for reducing passes to minimal required render passes

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 54b9ed2737
commit d5431653aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -469,12 +469,12 @@
"Path": "Passes/OpaqueParent.pass" "Path": "Passes/OpaqueParent.pass"
}, },
{ {
"Name": "ThumbnailPipeline", "Name": "ToolsPipeline",
"Path": "Passes/ThumbnailPipeline.pass" "Path": "Passes/ToolsPipeline.pass"
}, },
{ {
"Name": "ThumbnailPipelineRenderToTexture", "Name": "ToolsPipelineRenderToTexture",
"Path": "Passes/ThumbnailPipelineRenderToTexture.pass" "Path": "Passes/ToolsPipelineRenderToTexture.pass"
}, },
{ {
"Name": "TransparentParentTemplate", "Name": "TransparentParentTemplate",

@ -4,7 +4,7 @@
"ClassName": "PassAsset", "ClassName": "PassAsset",
"ClassData": { "ClassData": {
"PassTemplate": { "PassTemplate": {
"Name": "ThumbnailPipeline", "Name": "ToolsPipeline",
"PassClass": "ParentPass", "PassClass": "ParentPass",
"Slots": [ "Slots": [
{ {

@ -4,7 +4,7 @@
"ClassName": "PassAsset", "ClassName": "PassAsset",
"ClassData": { "ClassData": {
"PassTemplate": { "PassTemplate": {
"Name": "ThumbnailPipelineRenderToTexture", "Name": "ToolsPipelineRenderToTexture",
"PassClass": "RenderToTexturePass", "PassClass": "RenderToTexturePass",
"PassData": { "PassData": {
"$type": "RenderToTexturePassData", "$type": "RenderToTexturePassData",
@ -15,7 +15,7 @@
"PassRequests": [ "PassRequests": [
{ {
"Name": "Pipeline", "Name": "Pipeline",
"TemplateName": "ThumbnailPipeline", "TemplateName": "ToolsPipeline",
"Connections": [ "Connections": [
{ {
"LocalSlot": "SwapChainOutput", "LocalSlot": "SwapChainOutput",

@ -161,8 +161,8 @@ set(FILES
Passes/LutGeneration.pass Passes/LutGeneration.pass
Passes/MainPipeline.pass Passes/MainPipeline.pass
Passes/MainPipelineRenderToTexture.pass Passes/MainPipelineRenderToTexture.pass
Passes/ThumbnailPipeline.pass Passes/ToolsPipeline.pass
Passes/ThumbnailPipelineRenderToTexture.pass Passes/ToolsPipelineRenderToTexture.pass
Passes/MeshMotionVector.pass Passes/MeshMotionVector.pass
Passes/ModulateTexture.pass Passes/ModulateTexture.pass
Passes/MorphTarget.pass Passes/MorphTarget.pass

@ -61,7 +61,7 @@ namespace AtomToolsFramework
AZ::RPI::RenderPipelineDescriptor pipelineDesc; AZ::RPI::RenderPipelineDescriptor pipelineDesc;
pipelineDesc.m_mainViewTagName = "MainCamera"; pipelineDesc.m_mainViewTagName = "MainCamera";
pipelineDesc.m_name = pipelineName; pipelineDesc.m_name = pipelineName;
pipelineDesc.m_rootPassTemplate = "MainPipelineRenderToTexture"; pipelineDesc.m_rootPassTemplate = "ToolsPipelineRenderToTexture";
// We have to set the samples to 4 to match the pipeline passes' setting, otherwise it may lead to device lost issue // We have to set the samples to 4 to match the pipeline passes' setting, otherwise it may lead to device lost issue
// [GFX TODO] [ATOM-13551] Default value sand validation required to prevent pipeline crash and device lost // [GFX TODO] [ATOM-13551] Default value sand validation required to prevent pipeline crash and device lost

@ -71,6 +71,12 @@
} }
} }
], ],
"FallbackConnections": [
{
"Input": "DepthLinearInput",
"Output": "DepthLinear"
}
],
"PassRequests": [ "PassRequests": [
{ {
"Name": "HairGlobalShapeConstraintsComputePass", "Name": "HairGlobalShapeConstraintsComputePass",

@ -12,7 +12,8 @@
"SlotType": "InputOutput", "SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget" "ScopeAttachmentUsage": "RenderTarget"
}, },
{ // used for copy from MSAA to regular RT {
// used for copy from MSAA to regular RT
"Name": "RenderTargetInputOnly", "Name": "RenderTargetInputOnly",
"SlotType": "Input", "SlotType": "Input",
"ScopeAttachmentUsage": "Shader" "ScopeAttachmentUsage": "Shader"
@ -29,7 +30,7 @@
// If DepthLinear is not availbale - connect to another viewport (non MSAA) image. // If DepthLinear is not availbale - connect to another viewport (non MSAA) image.
{ {
"Name": "DepthLinearInput", "Name": "DepthLinearInput",
"SlotType": "InputOutput" "SlotType": "Input"
}, },
{ {
"Name": "DepthLinear", "Name": "DepthLinear",
@ -71,6 +72,12 @@
} }
} }
], ],
"FallbackConnections": [
{
"Input": "DepthLinearInput",
"Output": "DepthLinear"
}
],
"PassRequests": [ "PassRequests": [
{ {
"Name": "HairGlobalShapeConstraintsComputePass", "Name": "HairGlobalShapeConstraintsComputePass",
@ -257,7 +264,8 @@
"Attachment": "HairColorRenderTarget" "Attachment": "HairColorRenderTarget"
} }
}, },
{ // The final render target - this is MSAA mode RT - would it be cheaper to {
// The final render target - this is MSAA mode RT - would it be cheaper to
// use non-MSAA and then copy? // use non-MSAA and then copy?
"LocalSlot": "RenderTargetInputOutput", "LocalSlot": "RenderTargetInputOutput",
"AttachmentRef": { "AttachmentRef": {
@ -340,7 +348,8 @@
"TemplateName": "HairShortCutResolveColorPassTemplate", "TemplateName": "HairShortCutResolveColorPassTemplate",
"Enabled": true, "Enabled": true,
"Connections": [ "Connections": [
{ // The final render target - this is MSAA mode RT - would it be cheaper to {
// The final render target - this is MSAA mode RT - would it be cheaper to
// use non-MSAA and then copy? // use non-MSAA and then copy?
"LocalSlot": "RenderTargetInputOutput", "LocalSlot": "RenderTargetInputOutput",
"AttachmentRef": { "AttachmentRef": {

@ -144,25 +144,11 @@ namespace AZ
void HairFeatureProcessor::EnablePasses([[maybe_unused]] bool enable) void HairFeatureProcessor::EnablePasses([[maybe_unused]] bool enable)
{ {
return;
// [To Do] - This part should be enabled (remove the return) to reduce overhead
// when Hair is disabled / doesn't exist in the scene.
// Currently it might break features such as fog that depend on the output and for some
// reason doesn't quite work for ShortCut.
// The current overhead is minimal (< 0.1 msec) and this Gem is disabled by default.
/*
if (!m_initialized)
{
return;
}
RPI::Ptr<RPI::Pass> desiredPass = m_renderPipeline->GetRootPass()->FindPassByNameRecursive(HairParentPassName); RPI::Ptr<RPI::Pass> desiredPass = m_renderPipeline->GetRootPass()->FindPassByNameRecursive(HairParentPassName);
if (desiredPass) if (desiredPass)
{ {
desiredPass->SetEnabled(enable); desiredPass->SetEnabled(enable);
} }
*/
} }
bool HairFeatureProcessor::RemoveHairRenderObject(Data::Instance<HairRenderObject> renderObject) bool HairFeatureProcessor::RemoveHairRenderObject(Data::Instance<HairRenderObject> renderObject)
@ -184,15 +170,13 @@ namespace AZ
void HairFeatureProcessor::UpdateHairSkinning() void HairFeatureProcessor::UpdateHairSkinning()
{ {
// Copying CPU side m_SimCB content to the GPU buffer (matrices, wind parameters..) // Copying CPU side m_SimCB content to the GPU buffer (matrices, wind parameters..)
for (auto& hairRenderObject : m_hairRenderObjects)
for (auto objIter = m_hairRenderObjects.begin(); objIter != m_hairRenderObjects.end(); ++objIter)
{ {
if (!objIter->get()->IsEnabled()) if (hairRenderObject->IsEnabled())
{ {
return; hairRenderObject->Update();
} }
objIter->get()->Update();
} }
} }

Loading…
Cancel
Save