Merge branch 'stabilization/2106' of https://github.com/aws-lumberyard/o3de into Atom/gallowj/stabilization/2106

This commit is contained in:
gallowj
2021-06-11 14:53:08 -05:00
214 changed files with 1963 additions and 1056 deletions
@@ -295,6 +295,10 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float
lightingOutput.m_diffuseColor.rgb += lightingOutput.m_specularColor.rgb; // add specular
lightingOutput.m_specularColor.rgb = baseColor * (1.0 - lightingOutput.m_diffuseColor.w);
}
else
{
lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering
}
return lightingOutput;
}
@@ -341,4 +345,3 @@ ForwardPassOutput StandardPbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace :
#endif
return OUT;
}
@@ -322,7 +322,14 @@
"Pass": "AuxGeomPass",
"Attachment": "ColorInputOutput"
}
}
},
{
"LocalSlot": "DepthInputOutput",
"AttachmentRef": {
"Pass": "DepthPrePass",
"Attachment": "Depth"
}
}
]
},
{
@@ -427,6 +427,13 @@
"Pass": "DebugOverlayPass",
"Attachment": "InputOutput"
}
},
{
"LocalSlot": "DepthInputOutput",
"AttachmentRef": {
"Pass": "DepthPrePass",
"Attachment": "Depth"
}
}
]
},
@@ -7,6 +7,23 @@
"Name": "UIPassTemplate",
"PassClass": "RasterPass",
"Slots": [
{
"Name": "DepthInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "DepthStencil",
"LoadStoreAction": {
"ClearValue": {
"Type": "DepthStencil",
"Value": [
0.0,
0.0,
0.0,
0.0
]
},
"LoadActionStencil": "Clear"
}
},
{
"Name": "InputOutput",
"SlotType": "InputOutput",
@@ -10,6 +10,11 @@
{
"Name": "InputOutput",
"SlotType": "InputOutput"
},
{
"Name": "DepthInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "DepthStencil"
}
],
"PassRequests": [
@@ -24,6 +29,13 @@
"Pass": "Parent",
"Attachment": "InputOutput"
}
},
{
"LocalSlot": "DepthInputOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "DepthInputOutput"
}
}
],
"PassData": {
@@ -10,7 +10,5 @@
"type": "Compute"
}
]
},
"DisabledRHIBackends": ["metal"]
}
}
@@ -16,7 +16,10 @@
ShaderResourceGroup MorphTargetPassSrg : SRG_PerPass
{
RWBuffer<int> m_accumulatedDeltas;
//Since we do Interlocked atomic operations on this buffer it can not be RWBuffer due to broken MetalSL generation.
//It stems from the fact that typed buffers gets converted to textures and that breaks with atomic operations.
//In future we can handle this under the hood via our metal shader pipeline
RWStructuredBuffer<int> m_accumulatedDeltas;
}
// This class represents the data that is passed to the morph target compute shader of an individual delta
@@ -37,7 +37,7 @@ ShaderResourceGroup PassSrg : SRG_PerPass
Texture2D<float4> m_sceneLuminance;
// This should be of size NUM_HISTOGRAM_BINS.
Buffer<uint> m_histogram;
StructuredBuffer<uint> m_histogram;
Sampler LinearSampler
{
@@ -20,7 +20,11 @@
ShaderResourceGroup PassSrg : SRG_PerPass
{
Texture2D<float4> m_inputTexture;
RWBuffer<uint> m_outputTexture;
//Since we do Interlocked atomic operations on this buffer it can not be RWBuffer due to broken MetalSL generation.
//It stems from the fact that typed buffers gets converted to textures and that breaks with atomic operations.
//In future we can handle this under the hood via our metal shader pipeline
RWStructuredBuffer<uint> m_outputTexture;
}
groupshared uint shared_histogramBins[NUM_HISTOGRAM_BINS];
@@ -12,7 +12,5 @@
"type": "Compute"
}
]
},
"DisabledRHIBackends": ["metal"]
}
}
@@ -16,7 +16,7 @@
ShaderResourceGroup PassSrg : SRG_PerPass
{
RWBuffer<float> m_skinnedMeshOutputStream;
RWStructuredBuffer<float> m_skinnedMeshOutputStream;
}
ShaderResourceGroup InstanceSrg : SRG_PerDraw
@@ -48,7 +48,9 @@ namespace AZ
void SetShaperParams(const ShaperParams& shaperParams);
private:
explicit AcesOutputTransformLutPass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides...
void InitializeInternal() override;
// Scope producer functions...
void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
@@ -50,7 +50,9 @@ namespace AZ
private:
explicit AcesOutputTransformPass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides
void InitializeInternal() override;
// Scope producer functions...
void CompileResources(const RHI::FrameGraphCompileContext& context) override;
@@ -45,7 +45,9 @@ namespace AZ
protected:
explicit ApplyShaperLookupTablePass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides...
void InitializeInternal() override;
RHI::ShaderInputImageIndex m_shaderInputLutImageIndex;
@@ -57,15 +57,13 @@ namespace AZ
explicit BakeAcesOutputTransformLutPass(const RPI::PassDescriptor& descriptor);
// Pass behavior overrides...
void FrameBeginInternal(FramePrepareParams params) override;
void InitializeInternal() override;
// RHI::ScopeProducer overrides...
void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
void CompileResources(const RHI::FrameGraphCompileContext& context) override;
void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override;
void Init();
void AcquireLutImage();
void ReleaseLutImage();
@@ -41,14 +41,11 @@ namespace AZ
void SetInputReferencePassName(const Name& passName);
void SetInputReferenceAttachmentName(const Name& attachmentName);
// Pass behavior overrides
virtual void BuildAttachmentsInternal() override;
protected:
explicit DisplayMapperFullScreenPass(const RPI::PassDescriptor& descriptor);
// FullscreenTrianglePass behavior overrides
virtual void Init();
// Pass behavior overrides...
virtual void BuildInternal() override;
private:
Name m_inputReferencePassName = Name{ "Parent" };
@@ -76,7 +76,8 @@ namespace AZ
DisplayMapperPass(const RPI::PassDescriptor& descriptor);
// Pass behavior overrides
void BuildAttachmentsInternal() final;
void BuildInternal() final;
void InitializeInternal() final;
void FrameBeginInternal(FramePrepareParams params) final;
void FrameEndInternal() final;
void CreateChildPassesInternal() final;
@@ -49,7 +49,9 @@ namespace AZ
protected:
explicit OutputTransformPass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides
void InitializeInternal() override;
private:
// Scope producer functions...
@@ -42,7 +42,7 @@ namespace AZ
protected:
// Pass behavior overrides
void CreateChildPassesInternal() final;
void BuildAttachmentsInternal() final;
void BuildInternal() final;
void FrameBeginInternal(FramePrepareParams params) final;
private:
@@ -46,7 +46,7 @@ namespace AZ
private:
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
void UpdataAttachment();
@@ -60,7 +60,7 @@ namespace AZ
Base::FrameBeginInternal(params);
}
void CheckerboardColorResolvePass::BuildAttachmentsInternal()
void CheckerboardColorResolvePass::BuildInternal()
{
// For each bound attachments they are the inputs from current frame.
// We use them to get their owner CheckerboardPass then find the render targets from last frame
@@ -99,7 +99,7 @@ namespace AZ
// reset frame offset to 0 since attachments are rebuilt
m_frameOffset = 0;
Base::BuildAttachmentsInternal();
Base::BuildInternal();
}
void CheckerboardColorResolvePass::CompileResources(const RHI::FrameGraphCompileContext& context)
@@ -135,7 +135,7 @@ namespace AZ
void CheckerboardColorResolvePass::FrameEndInternal()
{
// For the input slots for current frame, they always get updated when CheckerboardPass updates the render targets
// But for the input slots for previous frame, we need to manually update them since they were manually attached in BuildAttachmentsInternal()
// But for the input slots for previous frame, we need to manually update them since they were manually attached in BuildInternal()
//
// When pass attachment was built, CheckerboardPass creates two resources for each render target.
// For example, diffuse_0 and diffuse_1 which diffuse_0 is for even frame and diffuse_1 is for odd frame.
@@ -52,7 +52,7 @@ namespace AZ
protected:
// Pass overrides...
void FrameBeginInternal(FramePrepareParams params) override;
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameEndInternal() override;
// Scope producer functions...
@@ -50,7 +50,7 @@ namespace AZ
Base::FrameBeginInternal(params);
}
void CheckerboardPass::BuildAttachmentsInternal()
void CheckerboardPass::BuildInternal()
{
Data::Instance<RPI::AttachmentImagePool> pool = RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool();
@@ -101,7 +101,7 @@ namespace AZ
// reset frame offset to 0 since attachments are rebuilt
m_frameOffset = 0;
Base::BuildAttachmentsInternal();
Base::BuildInternal();
}
@@ -40,7 +40,7 @@ namespace AZ
protected:
// Pass overrides...
void FrameBeginInternal(FramePrepareParams params);
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameEndInternal() override;
private:
@@ -100,7 +100,7 @@ namespace AZ
m_arraySize = arraySize;
m_updateChildren = true;
QueueForBuildAttachments();
QueueForBuildAndInitialization();
m_atlas.Initialize();
for (size_t cascadeIndex = 0; cascadeIndex < m_arraySize; ++cascadeIndex)
@@ -149,7 +149,7 @@ namespace AZ
return m_atlas;
}
void CascadedShadowmapsPass::BuildAttachmentsInternal()
void CascadedShadowmapsPass::BuildInternal()
{
UpdateChildren();
@@ -159,7 +159,7 @@ namespace AZ
}
UpdateShadowmapImageSize();
Base::BuildAttachmentsInternal();
Base::BuildInternal();
}
void CascadedShadowmapsPass::GetPipelineViewTags(RPI::SortedPipelineViewTags& outTags) const
@@ -215,7 +215,7 @@ namespace AZ
AZ_RPI_PASS_WARNING(child, "CascadedShadowmapsPass child Pass creation failed for %d", cascadeIndex);
if (child)
{
child->QueueForBuildAttachments();
child->QueueForBuildAndInitialization();
AddChild(child);
}
}
@@ -53,7 +53,7 @@ namespace AZ
explicit CascadedShadowmapsPass(const RPI::PassDescriptor& descriptor);
// RPI::Pass overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void GetPipelineViewTags(RPI::SortedPipelineViewTags& outTags) const override;
void GetViewDrawListInfo(RHI::DrawListMask& outDrawListMask, RPI::PassesByDrawList& outPassesByDrawList, const RPI::PipelineViewTag& viewTag) const override;
@@ -1106,7 +1106,7 @@ namespace AZ
{
for (EsmShadowmapsPass* pass : it.second)
{
pass->QueueForBuildAttachments();
pass->QueueForBuildAndInitialization();
}
}
}
@@ -163,7 +163,6 @@ namespace AZ
void LightCullingPass::ResetInternal()
{
m_initialized = false;
m_tileDataIndex = -1;
m_constantDataIndex.Reset();
@@ -260,7 +259,7 @@ namespace AZ
return gridPixelSize;
}
void LightCullingPass::BuildAttachmentsInternal()
void LightCullingPass::BuildInternal()
{
m_tileDataIndex = FindInputBinding(AZ::Name("TileLightData"));
CreateLightList();
@@ -50,7 +50,7 @@ namespace AZ
// Pass behavior overrides...
void ResetInternal()override;
void BuildAttachmentsInternal() override;
void BuildInternal() override;
// Scope producer functions...
void CompileResources(const RHI::FrameGraphCompileContext& context) override;
@@ -96,7 +96,6 @@ namespace AZ
AZ::RHI::ShaderInputNameIndex m_constantDataIndex = "m_constantData";
bool m_initialized = false;
Data::Instance<RPI::Buffer> m_lightList;
uint32_t m_tileDataIndex = -1;
@@ -108,7 +108,7 @@ namespace AZ
return -1;
}
void LightCullingRemap::BuildAttachmentsInternal()
void LightCullingRemap::BuildInternal()
{
m_tileDataIndex = FindInputOutputBinding(AZ::Name("TileLightData"));
m_tileDim = GetTileDataBufferResolution();
@@ -55,7 +55,7 @@ namespace AZ
// Pass behavior overrides...
void ResetInternal()override;
void BuildAttachmentsInternal() override;
void BuildInternal() override;
// RHI::ScopeProducer overrides...
void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
@@ -167,37 +167,36 @@ namespace AZ
AZ_Assert(setOk, "LightCullingTilePreparePass::SetConstantData() - could not set constant data");
}
void LightCullingTilePreparePass::BuildAttachmentsInternal()
void LightCullingTilePreparePass::BuildInternal()
{
ChooseShaderVariant();
}
void LightCullingTilePreparePass::OnShaderReinitialized(const AZ::RPI::Shader&)
void LightCullingTilePreparePass::OnShaderReloaded()
{
LoadShader();
if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments)
AZ_Assert(GetPassState() != RPI::PassState::Rendering, "LightCullingTilePreparePass: Trying to reload shader during rendering");
if (GetPassState() == RPI::PassState::Idle)
{
ChooseShaderVariant();
}
}
void LightCullingTilePreparePass::OnShaderReinitialized(const AZ::RPI::Shader&)
{
OnShaderReloaded();
}
void LightCullingTilePreparePass::OnShaderAssetReinitialized(const Data::Asset<AZ::RPI::ShaderAsset>&)
{
LoadShader();
if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments)
{
ChooseShaderVariant();
}
OnShaderReloaded();
}
void LightCullingTilePreparePass::OnShaderVariantReinitialized(
const AZ::RPI::Shader&, const AZ::RPI::ShaderVariantId&,
AZ::RPI::ShaderVariantStableId)
{
LoadShader();
if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments)
{
ChooseShaderVariant();
}
OnShaderReloaded();
}
} // namespace Render
@@ -50,7 +50,7 @@ namespace AZ
LightCullingTilePreparePass(const RPI::PassDescriptor& descriptor);
// Pass behavior overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
///////////////////////////////////////////////////////////////////
// ShaderReloadNotificationBus overrides...
@@ -73,6 +73,7 @@ namespace AZ
const AZ::RPI::ShaderVariant& CreateShaderVariant();
void CreatePipelineStateFromShaderVariant(const RPI::ShaderVariant& shaderVariant);
void SetConstantData();
void OnShaderReloaded();
AZ::RHI::ShaderInputNameIndex m_constantDataIndex = "m_constantData";
@@ -73,7 +73,7 @@ namespace AZ
{
m_sizes = sizes;
m_updateChildren = true;
QueueForBuildAttachments();
QueueForBuildAndInitialization();
m_atlas.Initialize();
for (const auto& it : m_sizes)
@@ -156,7 +156,7 @@ namespace AZ
return m_atlas;
}
void ProjectedShadowmapsPass::BuildAttachmentsInternal()
void ProjectedShadowmapsPass::BuildInternal()
{
UpdateChildren();
@@ -177,7 +177,7 @@ namespace AZ
imageDescriptor.m_size = RHI::Size(shadowmapWidth, shadowmapWidth, 1);
imageDescriptor.m_arraySize = m_atlas.GetArraySliceCount();
Base::BuildAttachmentsInternal();
Base::BuildInternal();
}
void ProjectedShadowmapsPass::GetPipelineViewTags(RPI::SortedPipelineViewTags& outTags) const
@@ -71,7 +71,7 @@ namespace AZ
explicit ProjectedShadowmapsPass(const RPI::PassDescriptor& descriptor);
// RPI::Pass overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void GetPipelineViewTags(RPI::SortedPipelineViewTags& outTags) const override;
void GetViewDrawListInfo(RHI::DrawListMask& outDrawListMask, RPI::PassesByDrawList& outPassesByDrawList, const RPI::PipelineViewTag& viewTag) const override;
@@ -107,7 +107,7 @@ namespace AZ
m_scissorState = scissor;
}
void ShadowmapPass::BuildAttachmentsInternal()
void ShadowmapPass::BuildInternal()
{
RPI::Ptr<RPI::ParentPass> parentPass = GetParent();
if (!parentPass)
@@ -135,7 +135,7 @@ namespace AZ
action.m_loadAction = m_clearEnabled ? RHI::AttachmentLoadAction::Clear : RHI::AttachmentLoadAction::DontCare;
binding.m_unifiedScopeDesc = RHI::UnifiedScopeAttachmentDescriptor(attachmentId, imageViewDescriptor, action);
Base::BuildAttachmentsInternal();
Base::BuildInternal();
}
} // namespace Render
@@ -58,7 +58,7 @@ namespace AZ
explicit ShadowmapPass(const RPI::PassDescriptor& descriptor);
// RHI::Pass overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
uint16_t m_arraySlice = 0;
bool m_clearEnabled = true;
@@ -42,9 +42,9 @@ namespace AZ
ReleaseLutImage();
}
void AcesOutputTransformLutPass::Init()
void AcesOutputTransformLutPass::InitializeInternal()
{
DisplayMapperFullScreenPass::Init();
DisplayMapperFullScreenPass::InitializeInternal();
AZ_Assert(m_shaderResourceGroup != nullptr, "AcesOutputTransformLutPass %s has a null shader resource group when calling Init.", GetPathName().GetCStr());
@@ -44,9 +44,9 @@ namespace AZ
{
}
void AcesOutputTransformPass::Init()
void AcesOutputTransformPass::InitializeInternal()
{
DisplayMapperFullScreenPass::Init();
DisplayMapperFullScreenPass::InitializeInternal();
AZ_Assert(m_shaderResourceGroup != nullptr, "AcesOutputTransformPass %s has a null shader resource group when calling Init.", GetPathName().GetCStr());
@@ -38,9 +38,9 @@ namespace AZ
ReleaseLutImage();
}
void ApplyShaperLookupTablePass::Init()
void ApplyShaperLookupTablePass::InitializeInternal()
{
DisplayMapperFullScreenPass::Init();
DisplayMapperFullScreenPass::InitializeInternal();
AZ_Assert(m_shaderResourceGroup != nullptr, "ApplyShaperLookupTablePass %s has a null shader resource group when calling Init.", GetPathName().GetCStr());
@@ -38,17 +38,7 @@ namespace AZ
ReleaseLutImage();
}
void BakeAcesOutputTransformLutPass::FrameBeginInternal(FramePrepareParams params)
{
if (!m_flags.m_initialized)
{
Init();
}
ComputePass::FrameBeginInternal(params);
}
void BakeAcesOutputTransformLutPass::Init()
void BakeAcesOutputTransformLutPass::InitializeInternal()
{
AZ_Assert(m_shaderResourceGroup != nullptr, "BakeAcesOutputTransformLutPass %s has a null shader resource group when calling Init.", GetPathName().GetCStr());
@@ -67,7 +57,6 @@ namespace AZ
m_shaderInputShaperBiasIndex = m_shaderResourceGroup->FindShaderInputConstantIndex(Name{ "m_shaperBias" });
m_shaderInputShaperScaleIndex = m_shaderResourceGroup->FindShaderInputConstantIndex(Name{ "m_shaperScale" });
}
m_flags.m_initialized = true;
}
void BakeAcesOutputTransformLutPass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph)
@@ -34,7 +34,7 @@ namespace AZ
{
}
void DisplayMapperFullScreenPass::BuildAttachmentsInternal()
void DisplayMapperFullScreenPass::BuildInternal()
{
RPI::PassConnection inConnection;
inConnection.m_localSlot = InputAttachmentName;
@@ -53,9 +53,5 @@ namespace AZ
m_inputReferenceAttachmentName = attachmentName;
}
void DisplayMapperFullScreenPass::Init()
{
FullscreenTrianglePass::Init();
}
} // namespace Render
} // namespace AZ
@@ -46,8 +46,6 @@ namespace AZ
DisplayMapperPass::DisplayMapperPass(const RPI::PassDescriptor& descriptor)
: RPI::ParentPass(descriptor)
{
m_flags.m_alreadyCreated = false;
AzFramework::NativeWindowHandle windowHandle = nullptr;
AzFramework::WindowSystemRequestBus::BroadcastResult(
windowHandle,
@@ -61,8 +59,6 @@ namespace AZ
{
m_displayMapperConfigurationDescriptor = passData->m_config;
}
m_needToRebuildChildren = true;
}
DisplayMapperPass::~DisplayMapperPass()
@@ -86,7 +82,7 @@ namespace AZ
const Name& passName = fullscreenTrianglePass->GetName();
if (passName.GetStringView() == "CopyToSwapChain")
{
fullscreenTrianglePass->Invalidate();
fullscreenTrianglePass->QueueForInitialization();
}
}
}
@@ -137,7 +133,7 @@ namespace AZ
}
}
void DisplayMapperPass::BuildAttachmentsInternal()
void DisplayMapperPass::BuildInternal()
{
const Name outputName = Name{ "Output" };
Name inputPass = Name{ "Parent" };
@@ -187,7 +183,21 @@ namespace AZ
m_swapChainAttachmentBinding = FindAttachmentBinding(Name("SwapChainOutput"));
ParentPass::BuildAttachmentsInternal();
ParentPass::BuildInternal();
}
void DisplayMapperPass::InitializeInternal()
{
// Force update on bindings because children of display mapper pass have their outputs connect to
// their parent's output, which is a non-conventional and non-standard workflow. Parent outputs are
// updated after child outputs, so post-build the child outputs do not yet point to the attachments on
// the parent bindings they are connected to. Forcing this refresh sets the attachment on the child output.
for (const RPI::Ptr<Pass>& child : m_children)
{
child->UpdateConnectedBindings();
}
RPI::ParentPass::InitializeInternal();
}
void DisplayMapperPass::FrameBeginInternal(FramePrepareParams params)
@@ -199,24 +209,14 @@ namespace AZ
void DisplayMapperPass::FrameEndInternal()
{
GetDisplayMapperConfiguration();
if (m_needToRebuildChildren)
{
ClearChildren();
BuildGradingLutTemplate();
CreateGradingAndAcesPasses();
}
ParentPass::FrameEndInternal();
}
void DisplayMapperPass::CreateChildPassesInternal()
{
if (m_needToRebuildChildren)
{
ClearChildren();
BuildGradingLutTemplate();
CreateGradingAndAcesPasses();
}
ParentPass::CreateChildPassesInternal();
ClearChildren();
BuildGradingLutTemplate();
CreateGradingAndAcesPasses();
}
AZStd::shared_ptr<RPI::PassTemplate> CreatePassTemplateHelper(
@@ -485,7 +485,6 @@ namespace AZ
{
AddChild(m_ldrGradingLookupTablePass);
}
m_needToRebuildChildren = false;
}
void DisplayMapperPass::GetDisplayMapperConfiguration()
@@ -513,7 +512,8 @@ namespace AZ
desc.m_ldrColorGradingLut != m_displayMapperConfigurationDescriptor.m_ldrColorGradingLut ||
desc.m_acesParameterOverrides.m_overrideDefaults != m_displayMapperConfigurationDescriptor.m_acesParameterOverrides.m_overrideDefaults)
{
m_needToRebuildChildren = true;
m_flags.m_createChildren = true;
QueueForBuildAndInitialization();
}
m_displayMapperConfigurationDescriptor = desc;
}
@@ -527,41 +527,15 @@ namespace AZ
void DisplayMapperPass::ClearChildren()
{
if (m_acesOutputTransformPass)
{
RemoveChild(m_acesOutputTransformPass);
m_acesOutputTransformPass = nullptr;
}
if (m_bakeAcesOutputTransformLutPass)
{
RemoveChild(m_bakeAcesOutputTransformLutPass);
m_bakeAcesOutputTransformLutPass = nullptr;
}
if (m_acesOutputTransformLutPass)
{
RemoveChild(m_acesOutputTransformLutPass);
m_acesOutputTransformLutPass = nullptr;
}
if (m_displayMapperPassthroughPass)
{
RemoveChild(m_displayMapperPassthroughPass);
m_displayMapperPassthroughPass = nullptr;
}
if (m_displayMapperOnlyGammaCorrectionPass)
{
RemoveChild(m_displayMapperOnlyGammaCorrectionPass);
m_displayMapperOnlyGammaCorrectionPass = nullptr;
}
if (m_ldrGradingLookupTablePass)
{
RemoveChild(m_ldrGradingLookupTablePass);
m_ldrGradingLookupTablePass = nullptr;
}
if (m_outputTransformPass)
{
RemoveChild(m_outputTransformPass);
m_outputTransformPass = nullptr;
}
RemoveChildren();
m_acesOutputTransformPass = nullptr;
m_bakeAcesOutputTransformLutPass = nullptr;
m_acesOutputTransformLutPass = nullptr;
m_displayMapperPassthroughPass = nullptr;
m_displayMapperOnlyGammaCorrectionPass = nullptr;
m_ldrGradingLookupTablePass = nullptr;
m_outputTransformPass = nullptr;
}
} // namespace Render
} // namespace AZ
@@ -39,9 +39,9 @@ namespace AZ
{
}
void OutputTransformPass::Init()
void OutputTransformPass::InitializeInternal()
{
DisplayMapperFullScreenPass::Init();
DisplayMapperFullScreenPass::InitializeInternal();
AZ_Assert(m_shaderResourceGroup != nullptr, "OutputTransformPass %s has a null shader resource group when calling Init.", GetPathName().GetCStr());
@@ -519,13 +519,13 @@ namespace AZ
io.Fonts->TexID = reinterpret_cast<ImTextureID>(m_fontAtlas.get());
}
void ImGuiPass::OnBuildAttachmentsFinishedInternal()
void ImGuiPass::InitializeInternal()
{
// Set output format and finalize pipeline state
m_pipelineState->SetOutputFromPass(this);
m_pipelineState->Finalize();
Base::OnBuildAttachmentsFinishedInternal();
Base::InitializeInternal();
}
void ImGuiPass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph)
@@ -94,7 +94,7 @@ namespace AZ
explicit ImGuiPass(const RPI::PassDescriptor& descriptor);
// Pass Behaviour Overrides...
void OnBuildAttachmentsFinishedInternal() override;
void InitializeInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
// Scope producer functions
@@ -28,8 +28,6 @@ namespace AZ
LuxCoreTexturePass::LuxCoreTexturePass(const RPI::PassDescriptor& descriptor)
: ParentPass(descriptor)
{
m_flags.m_alreadyCreated = false;
RPI::PassSystemInterface* passSystem = RPI::PassSystemInterface::Get();
// Create render target pass
@@ -41,8 +39,6 @@ namespace AZ
// Create readback
m_readback = AZStd::make_shared<AZ::RPI::AttachmentReadback>(AZ::RHI::ScopeId{ Uuid::CreateRandom().ToString<AZStd::string>() });
CreateChildPasses();
}
LuxCoreTexturePass::~LuxCoreTexturePass()
@@ -61,9 +57,9 @@ namespace AZ
AddChild(m_renderTargetPass);
}
void LuxCoreTexturePass::BuildAttachmentsInternal()
void LuxCoreTexturePass::BuildInternal()
{
ParentPass::BuildAttachmentsInternal();
ParentPass::BuildInternal();
}
void LuxCoreTexturePass::FrameBeginInternal(FramePrepareParams params)
@@ -38,13 +38,13 @@ namespace AZ
m_attachmentSize = image->GetRHIImage()->GetDescriptor().m_size;
m_attachmentFormat = format;
m_shaderResourceGroup->SetImage(m_textureIndex, image);
QueueForBuildAttachments();
QueueForBuildAndInitialization();
}
void RenderTexturePass::BuildAttachmentsInternal()
void RenderTexturePass::BuildInternal()
{
UpdataAttachment();
FullscreenTrianglePass::BuildAttachmentsInternal();
FullscreenTrianglePass::BuildInternal();
}
void RenderTexturePass::FrameBeginInternal(FramePrepareParams params)
@@ -44,7 +44,7 @@ namespace AZ
m_skinnedMeshFeatureProcessor = skinnedMeshFeatureProcessor;
}
void MorphTargetComputePass::BuildAttachmentsInternal()
void MorphTargetComputePass::BuildInternal()
{
// The same buffer that skinning writes to is used to manage the computed vertex deltas that are passed from the
// morph target pass to the skinning pass. This simplifies things by only requiring one class to manage the memory
@@ -37,7 +37,7 @@ namespace AZ
void SetFeatureProcessor(SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor);
private:
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override;
SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor = nullptr;
@@ -43,14 +43,9 @@ namespace AZ
ReleaseLutImage();
}
void BlendColorGradingLutsPass::FrameBeginInternal(FramePrepareParams params)
void BlendColorGradingLutsPass::InitializeInternal()
{
if (!m_flags.m_initialized)
{
Init();
}
ComputePass::FrameBeginInternal(params);
InitializeShaderVariant();
}
void BlendColorGradingLutsPass::InitializeShaderVariant()
@@ -106,12 +101,6 @@ namespace AZ
m_needToUpdateShaderVariant = false;
}
void BlendColorGradingLutsPass::Init()
{
InitializeShaderVariant();
m_flags.m_initialized = true;
}
void BlendColorGradingLutsPass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph)
{
ComputePass::SetupFrameGraphDependencies(frameGraph);
@@ -56,7 +56,7 @@ namespace AZ
explicit BlendColorGradingLutsPass(const RPI::PassDescriptor& descriptor);
// Pass behavior overrides...
void FrameBeginInternal(FramePrepareParams params) override;
void InitializeInternal() override;
// Scope producer functions...
void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
@@ -66,8 +66,6 @@ namespace AZ
void InitializeShaderVariant();
void UpdateCurrentShaderVariant();
void Init();
void AcquireLutImage();
void ReleaseLutImage();
@@ -252,10 +252,10 @@ namespace AZ
}
}
void BloomBlurPass::BuildAttachmentsInternal()
void BloomBlurPass::BuildInternal()
{
BuildChildPasses();
ParentPass::BuildAttachmentsInternal();
ParentPass::BuildInternal();
}
void BloomBlurPass::FrameBeginInternal(FramePrepareParams params)
@@ -47,7 +47,7 @@ namespace AZ
BloomBlurPass(const RPI::PassDescriptor& descriptor);
// Pass behaviour overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
void GetInputInfo();
@@ -56,10 +56,10 @@ namespace AZ
m_passData = *passData;
}
void BloomCompositePass::BuildAttachmentsInternal()
void BloomCompositePass::BuildInternal()
{
BuildChildPasses();
ParentPass::BuildAttachmentsInternal();
ParentPass::BuildInternal();
}
void BloomCompositePass::FrameBeginInternal(FramePrepareParams params)
@@ -44,7 +44,7 @@ namespace AZ
BloomCompositePass(const RPI::PassDescriptor& descriptor);
// Pass behaviour overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
void GetAttachmentInfo();
@@ -74,10 +74,10 @@ namespace AZ
AddAttachmentBinding(outBinding);
}
ComputePass::BuildAttachmentsInternal();
ComputePass::BuildInternal();
}
void BloomDownsamplePass::BuildAttachmentsInternal()
void BloomDownsamplePass::BuildInternal()
{
BuildOutAttachmentBinding();
}
@@ -37,7 +37,7 @@ namespace AZ
BloomDownsamplePass(const RPI::PassDescriptor& descriptor);
// Pass Behaviour Overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
void BuildOutAttachmentBinding();
@@ -43,9 +43,9 @@ namespace AZ
{
}
void DepthOfFieldBokehBlurPass::Init()
void DepthOfFieldBokehBlurPass::InitializeInternal()
{
FullscreenTrianglePass::Init();
FullscreenTrianglePass::InitializeInternal();
m_sampleNumberIndex.Reset();
m_radiusMinIndex.Reset();
@@ -39,11 +39,11 @@ namespace AZ
protected:
// Behaviour functions override...
void InitializeInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
private:
DepthOfFieldBokehBlurPass(const RPI::PassDescriptor& descriptor);
void Init() override;
void InitializeShaderVariant();
void UpdateCurrentShaderVariant();
@@ -40,9 +40,9 @@ namespace AZ
{
}
void DepthOfFieldCompositePass::Init()
void DepthOfFieldCompositePass::InitializeInternal()
{
FullscreenTrianglePass::Init();
FullscreenTrianglePass::InitializeInternal();
m_backBlendFactorDivision2Index.Reset();
m_backBlendFactorDivision4Index.Reset();
@@ -37,11 +37,11 @@ namespace AZ
protected:
// Pass behavior overrides...
void InitializeInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
private:
DepthOfFieldCompositePass(const RPI::PassDescriptor& descriptor);
void Init() override;
void InitializeShaderVariant();
void UpdateCurrentShaderVariant();
@@ -52,7 +52,7 @@ namespace AZ
return depth;
}
void DepthOfFieldCopyFocusDepthToCpuPass::BuildAttachmentsInternal()
void DepthOfFieldCopyFocusDepthToCpuPass::BuildInternal()
{
SetScopeId(RHI::ScopeId(GetPathName()));
}
@@ -48,7 +48,7 @@ namespace AZ
void BuildCommandList(const RHI::FrameGraphExecuteContext& context) override;
// Pass overrides
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
RPI::Ptr<RPI::Buffer> m_bufferRef;
@@ -33,9 +33,9 @@ namespace AZ
{
}
void DepthOfFieldMaskPass::Init()
void DepthOfFieldMaskPass::InitializeInternal()
{
FullscreenTrianglePass::Init();
FullscreenTrianglePass::InitializeInternal();
m_blendFactorIndex.Reset();
m_inputResolutionInverseIndex.Reset();
@@ -37,11 +37,11 @@ namespace AZ
protected:
// Pass behavior overrides...
void InitializeInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
private:
DepthOfFieldMaskPass(const RPI::PassDescriptor& descriptor);
virtual void Init() override;
// SRG binding indices...
RHI::ShaderInputNameIndex m_blendFactorIndex = "m_blendFactor";
@@ -34,18 +34,6 @@ namespace AZ
DepthOfFieldReadBackFocusDepthPass::DepthOfFieldReadBackFocusDepthPass(const RPI::PassDescriptor& descriptor)
: ParentPass(descriptor)
{
RPI::PassSystemInterface* passSystem = RPI::PassSystemInterface::Get();
// Create read back pass
m_readbackPass = passSystem->CreatePass<DepthOfFieldCopyFocusDepthToCpuPass>(AZ::Name("DepthOfFieldReadBackPass"));
AZ_Assert(m_readbackPass, "DepthOfFieldReadBackFocusDepthPass : read back pass is invalid");
AddChild(m_readbackPass);
// Find GetDepth pass on template
auto pass = FindChildPass(Name("DepthOfFieldWriteFocusDepthFromGpu"));
m_getDepthPass = static_cast<DepthOfFieldWriteFocusDepthFromGpuPass*>(pass.get());
// Create buffer for read back focus depth. We append static counter to avoid name conflicts.
RPI::CommonBufferDescriptor desc;
desc.m_bufferName = "DepthOfFieldReadBackAutoFocusDepthBuffer";
@@ -55,9 +43,6 @@ namespace AZ
desc.m_bufferData = nullptr;
desc.m_elementFormat = RHI::Format::R32_FLOAT;
m_buffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
m_getDepthPass->SetBufferRef(m_buffer);
m_readbackPass->SetBufferRef(m_buffer);
}
DepthOfFieldReadBackFocusDepthPass::~DepthOfFieldReadBackFocusDepthPass()
@@ -85,6 +70,24 @@ namespace AZ
}
}
void DepthOfFieldReadBackFocusDepthPass::CreateChildPassesInternal()
{
RPI::PassSystemInterface* passSystem = RPI::PassSystemInterface::Get();
// Create read back pass
m_readbackPass = passSystem->CreatePass<DepthOfFieldCopyFocusDepthToCpuPass>(AZ::Name("DepthOfFieldReadBackPass"));
AZ_Assert(m_readbackPass, "DepthOfFieldReadBackFocusDepthPass : read back pass is invalid");
AddChild(m_readbackPass);
// Find GetDepth pass on template
auto pass = FindChildPass(Name("DepthOfFieldWriteFocusDepthFromGpu"));
m_getDepthPass = static_cast<DepthOfFieldWriteFocusDepthFromGpuPass*>(pass.get());
m_getDepthPass->SetBufferRef(m_buffer);
m_readbackPass->SetBufferRef(m_buffer);
}
void DepthOfFieldReadBackFocusDepthPass::FrameBeginInternal(FramePrepareParams params)
{
RPI::Scene* scene = GetScene();
@@ -43,6 +43,7 @@ namespace AZ
protected:
// Pass behavior overrides...
void CreateChildPassesInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
private:
@@ -62,9 +62,9 @@ namespace AZ
m_bufferRef = bufferRef;
}
void DepthOfFieldWriteFocusDepthFromGpuPass::BuildAttachmentsInternal()
void DepthOfFieldWriteFocusDepthFromGpuPass::BuildInternal()
{
AZ_Assert(m_bufferRef != nullptr, "%s has a null buffer when calling BuildAttachmentsInternal.", GetPathName().GetCStr());
AZ_Assert(m_bufferRef != nullptr, "%s has a null buffer when calling BuildInternal.", GetPathName().GetCStr());
AttachBufferToSlot(Name("DofDepthInputOutput"), m_bufferRef);
}
@@ -51,7 +51,7 @@ namespace AZ
void CompileResources(const RHI::FrameGraphCompileContext& context) override;
// Pass overrides
void BuildAttachmentsInternal() override;
void BuildInternal() override;
};
} // namespace Render
} // namespace AZ
@@ -60,7 +60,7 @@ namespace AZ
m_buffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
}
void EyeAdaptationPass::BuildAttachmentsInternal()
void EyeAdaptationPass::BuildInternal()
{
if (!m_buffer)
{
@@ -58,7 +58,7 @@ namespace AZ
float m_exposureValue = 1.0f;
};
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
@@ -48,9 +48,9 @@ namespace AZ
}
}
void LookModificationCompositePass::Init()
void LookModificationCompositePass::InitializeInternal()
{
FullscreenTrianglePass::Init();
FullscreenTrianglePass::InitializeInternal();
m_shaderColorGradingLutImageIndex.Reset();
m_shaderColorGradingShaperTypeIndex.Reset();
@@ -60,9 +60,9 @@ namespace AZ
protected:
LookModificationCompositePass(const RPI::PassDescriptor& descriptor);
void Init() override;
//! Pass behavior overrides
void InitializeInternal() override;
void FrameBeginInternal(FramePrepareParams params) final;
private:
@@ -36,10 +36,10 @@ namespace AZ
&AzFramework::WindowSystemRequestBus::Events::GetDefaultWindowHandle);
}
void LookModificationPass::BuildAttachmentsInternal()
void LookModificationPass::BuildInternal()
{
m_swapChainAttachmentBinding = FindAttachmentBinding(Name("SwapChainOutput"));
ParentPass::BuildAttachmentsInternal();
ParentPass::BuildInternal();
}
void LookModificationPass::FrameBeginInternal([[maybe_unused]] FramePrepareParams params)
@@ -52,7 +52,7 @@ namespace AZ
//! Pass overrides ...
void FrameBeginInternal(FramePrepareParams params) override;
void BuildAttachmentsInternal() override;
void BuildInternal() override;
private:
const RPI::PassAttachmentBinding* m_swapChainAttachmentBinding = nullptr;
@@ -67,7 +67,7 @@ namespace AZ
desc.m_bufferName = "LuminanceHistogramBuffer";
desc.m_elementSize = sizeof(uint32_t);
desc.m_byteCount = NumHistogramBins * sizeof(uint32_t);
desc.m_elementFormat = RHI::Format::R32_UINT;
desc.m_elementFormat = RHI::Format::Unknown;
m_histogram = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc);
AZ_Assert(m_histogram != nullptr, "Unable to allocate buffer");
}
@@ -81,7 +81,7 @@ namespace AZ
return colorBuffer->m_descriptor.m_image.m_size;
}
void LuminanceHistogramGeneratorPass::BuildAttachmentsInternal()
void LuminanceHistogramGeneratorPass::BuildInternal()
{
CreateHistogramBuffer();
AttachHistogramBuffer();
@@ -42,7 +42,7 @@ namespace AZ
protected:
LuminanceHistogramGeneratorPass(const RPI::PassDescriptor& descriptor);
virtual void BuildAttachmentsInternal() override;
virtual void BuildInternal() override;
void CreateHistogramBuffer();
void AttachHistogramBuffer();
AZ::RHI::Size GetColorBufferResolution();
@@ -43,9 +43,9 @@ namespace AZ
{
}
void SMAABasePass::Init()
void SMAABasePass::InitializeInternal()
{
FullscreenTrianglePass::Init();
FullscreenTrianglePass::InitializeInternal();
AZ_Assert(m_shaderResourceGroup != nullptr, "SMAABasePass %s has a null shader resource group when calling Init.", GetPathName().GetCStr());
@@ -41,9 +41,12 @@ namespace AZ
protected:
SMAABasePass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides...
void InitializeInternal() override;
// An interface to update pass srg.
virtual void UpdateSRG() = 0;
// An interface to get current shader variation option.
virtual void GetCurrentShaderOption(AZ::RPI::ShaderOptionGroup& shaderOption) const = 0;
@@ -94,9 +94,9 @@ namespace AZ
}
}
void SMAABlendingWeightCalculationPass::Init()
void SMAABlendingWeightCalculationPass::InitializeInternal()
{
SMAABasePass::Init();
SMAABasePass::InitializeInternal();
AZ_Assert(m_shaderResourceGroup != nullptr, "SMAABlendingWeightCalculationPass %s has a null shader resource group when calling Init.", GetPathName().GetCStr());
@@ -43,7 +43,9 @@ namespace AZ
private:
SMAABlendingWeightCalculationPass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides...
void InitializeInternal() override;
// SMAABasePass functions...
void UpdateSRG() override;
@@ -48,9 +48,9 @@ namespace AZ
{
}
void SMAAEdgeDetectionPass::Init()
void SMAAEdgeDetectionPass::InitializeInternal()
{
SMAABasePass::Init();
SMAABasePass::InitializeInternal();
m_renderTargetMetricsShaderInputIndex.Reset();
m_chromaThresholdShaderInputIndex.Reset();
@@ -45,7 +45,9 @@ namespace AZ
private:
SMAAEdgeDetectionPass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides
void InitializeInternal() override;
// SMAABasePass functions...
void UpdateSRG() override;
@@ -47,9 +47,9 @@ namespace AZ
{
}
void SMAANeighborhoodBlendingPass::Init()
void SMAANeighborhoodBlendingPass::InitializeInternal()
{
SMAABasePass::Init();
SMAABasePass::InitializeInternal();
m_renderTargetMetricsShaderInputIndex.Reset();
}
@@ -37,7 +37,9 @@ namespace AZ
private:
SMAANeighborhoodBlendingPass(const RPI::PassDescriptor& descriptor);
void Init() override;
// Pass behavior overrides
void InitializeInternal() override;
// SMAABasePass functions...
void UpdateSRG() override;
@@ -41,9 +41,9 @@ namespace AZ
return ParentPass::IsEnabled();
}
void SsaoParentPass::OnBuildAttachmentsFinishedInternal()
void SsaoParentPass::InitializeInternal()
{
ParentPass::OnBuildAttachmentsFinishedInternal();
ParentPass::InitializeInternal();
m_blurParentPass = FindChildPass(Name("SsaoBlur"))->AsParent();
AZ_Assert(m_blurParentPass, "[SsaoParentPass] Could not retrieve parent blur pass.");
@@ -36,7 +36,7 @@ namespace AZ
protected:
// Behavior functions override...
void OnBuildAttachmentsFinishedInternal() override;
void InitializeInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
private:
@@ -108,7 +108,7 @@ namespace AZ::Render
Base::ResetInternal();
}
void TaaPass::BuildAttachmentsInternal()
void TaaPass::BuildInternal()
{
m_accumulationAttachments[0] = FindAttachment(Name("Accumulation1"));
m_accumulationAttachments[1] = FindAttachment(Name("Accumulation2"));
@@ -143,7 +143,7 @@ namespace AZ::Render
m_outputColorBinding->SetAttachment(m_accumulationAttachments[1]);
}
Base::BuildAttachmentsInternal();
Base::BuildInternal();
}
void TaaPass::UpdateAttachmentImage(RPI::Ptr<RPI::PassAttachment>& attachment)
@@ -63,7 +63,7 @@ namespace AZ::Render
// Pass behavior overrides...
void FrameBeginInternal(FramePrepareParams params) override;
void ResetInternal() override;
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void UpdateAttachmentImage(RPI::Ptr<RPI::PassAttachment>& attachment);
@@ -42,7 +42,7 @@ namespace AZ
}
}
void RayTracingAccelerationStructurePass::BuildAttachmentsInternal()
void RayTracingAccelerationStructurePass::BuildInternal()
{
SetScopeId(RHI::ScopeId(GetPathName()));
}
@@ -44,7 +44,7 @@ namespace AZ
void BuildCommandList(const RHI::FrameGraphExecuteContext& context) override;
// Pass overrides
void BuildAttachmentsInternal() override;
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
// buffer view descriptor for the TLAS
@@ -30,7 +30,7 @@ namespace AZ
{
}
void ReflectionCopyFrameBufferPass::BuildAttachmentsInternal()
void ReflectionCopyFrameBufferPass::BuildInternal()
{
RPI::PassHierarchyFilter passFilter(AZ::Name("ReflectionScreenSpaceBlurPass"));
const AZStd::vector<RPI::Pass*>& passes = RPI::PassSystemInterface::Get()->FindPasses(passFilter);
@@ -43,7 +43,7 @@ namespace AZ
AttachImageToSlot(outputBinding.m_name, frameBufferAttachment);
}
FullscreenTrianglePass::BuildAttachmentsInternal();
FullscreenTrianglePass::BuildInternal();
}
} // namespace RPI
} // namespace AZ
@@ -37,7 +37,7 @@ namespace AZ
explicit ReflectionCopyFrameBufferPass(const RPI::PassDescriptor& descriptor);
// Pass Overrides...
void BuildAttachmentsInternal() override;
void BuildInternal() override;
};
} // namespace RPI
} // namespace AZ
@@ -47,7 +47,7 @@ namespace AZ
RemoveChildren();
}
void ReflectionScreenSpaceBlurPass::CreateChildPasses(uint32_t numBlurMips)
void ReflectionScreenSpaceBlurPass::CreateChildPassesInternal()
{
RPI::PassSystemInterface* passSystem = RPI::PassSystemInterface::Get();
@@ -83,7 +83,7 @@ namespace AZ
horizontalBlurChildDesc.m_passTemplate = blurHorizontalPassTemplate;
// add child passes to perform the vertical and horizontal Gaussian blur for each roughness mip level
for (uint32_t mip = 0; mip < numBlurMips; ++mip)
for (uint32_t mip = 0; mip < m_numBlurMips; ++mip)
{
// create Vertical blur child passes
{
@@ -113,9 +113,10 @@ namespace AZ
}
}
void ReflectionScreenSpaceBlurPass::BuildAttachmentsInternal()
void ReflectionScreenSpaceBlurPass::BuildInternal()
{
RemoveChildren();
m_flags.m_createChildren = true;
Data::Instance<RPI::AttachmentImagePool> pool = RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool();
@@ -163,12 +164,11 @@ namespace AZ
m_ownedAttachments.push_back(transientPassAttachment);
}
// create child passes, one vertical and one horizontal blur per mip level
CreateChildPasses(mipLevels - 1);
m_numBlurMips = mipLevels - 1;
// call ParentPass::BuildAttachmentsInternal() first to configure the slots and auto-add the empty bindings,
// call ParentPass::BuildInternal() first to configure the slots and auto-add the empty bindings,
// then we will assign attachments to the bindings
ParentPass::BuildAttachmentsInternal();
ParentPass::BuildInternal();
// setup attachment bindings on vertical blur child passes
uint32_t attachmentIndex = 0;
@@ -40,16 +40,17 @@ namespace AZ
private:
explicit ReflectionScreenSpaceBlurPass(const RPI::PassDescriptor& descriptor);
void CreateChildPasses(uint32_t numBlurMips);
void CreateChildPassesInternal() override;
// Pass Overrides...
void ResetInternal() override;
void BuildAttachmentsInternal() override;
void BuildInternal() override;
AZStd::vector<RPI::Ptr<RPI::FullscreenTrianglePass>> m_verticalBlurChildPasses;
AZStd::vector<RPI::Ptr<RPI::FullscreenTrianglePass>> m_horizontalBlurChildPasses;
Data::Instance<RPI::AttachmentImage> m_frameBufferImageAttachment;
uint32_t m_numBlurMips = 0;
};
} // namespace RPI
} // namespace AZ
@@ -46,9 +46,9 @@ namespace AZ
}
void DeferredFogPass::Init()
void DeferredFogPass::InitializeInternal()
{
FullscreenTrianglePass::Init();
FullscreenTrianglePass::InitializeInternal();
// The following will ensure that in the case of data driven pass, the settings will get
// updated by the pass enable state.
@@ -43,13 +43,11 @@ namespace AZ
{
AZ_RPI_PASS(DeferredFogPass);
public:
AZ_RTTI(DeferredFogPass, "{0406C8AB-E95D-43A7-AF53-BDEE22D36746}", RPI::FullscreenTrianglePass);
AZ_CLASS_ALLOCATOR(DeferredFogPass, SystemAllocator, 0);
~DeferredFogPass() = default;
void Init() override;
static RPI::Ptr<DeferredFogPass> Create(const RPI::PassDescriptor& descriptor);
@@ -57,12 +55,16 @@ namespace AZ
virtual bool IsEnabled() const override;
void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
void CompileResources(const RHI::FrameGraphCompileContext& context) override;
protected:
DeferredFogPass(const RPI::PassDescriptor& descriptor);
// Pass behavior overrides...
void InitializeInternal() override;
// Scope producer functions...
void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
void CompileResources(const RHI::FrameGraphCompileContext& context) override;
//! Set the binding indices of all members of the SRG
void SetSrgBindIndices();
@@ -526,7 +526,7 @@ namespace AZ::Render
for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses)
{
esmPass->QueueForBuildAttachments();
esmPass->QueueForBuildAndInitialization();
}
for (ProjectedShadowmapsPass* shadowPass : m_projectedShadowmapsPasses)
@@ -67,8 +67,8 @@ namespace AZ
creator.SetBuffer(nullptr, 0, bufferDescriptor);
RHI::BufferViewDescriptor viewDescriptor;
viewDescriptor.m_elementFormat = RHI::Format::R32_FLOAT;
viewDescriptor.m_elementSize = RHI::GetFormatSize(viewDescriptor.m_elementFormat);
viewDescriptor.m_elementFormat = RHI::Format::Unknown;
viewDescriptor.m_elementSize = sizeof(float);
viewDescriptor.m_elementCount = aznumeric_cast<uint32_t>(m_sizeInBytes) / viewDescriptor.m_elementSize;
viewDescriptor.m_elementOffset = 0;
creator.SetBufferViewDescriptor(viewDescriptor);

Some files were not shown because too many files have changed in this diff Show More