Merge pull request #1525 from aws-lumberyard-dev/debugcascade

Fix for shader option in DepthExponentiation not being set on loading into Editor
This commit is contained in:
mrieggeramzn
2021-06-23 13:59:25 -07:00
committed by GitHub
3 changed files with 15 additions and 3 deletions
@@ -37,9 +37,13 @@ namespace AZ
InitializeShaderOption();
m_shaderOptionInitialized = true;
}
m_shadowmapType = type;
const uint32_t typeIndex = aznumeric_cast<uint32_t>(type);
SetShaderVariantKeyFallbackValue();
}
void DepthExponentiationPass::SetShaderVariantKeyFallbackValue()
{
const uint32_t typeIndex = aznumeric_cast<uint32_t>(m_shadowmapType);
RPI::ShaderOptionGroup shaderOption = m_shader->CreateShaderOptionGroup();
shaderOption.SetValue(m_optionName, m_optionValues[typeIndex]);
@@ -54,6 +58,11 @@ namespace AZ
return m_shadowmapType;
}
void DepthExponentiationPass::BuildInternal()
{
InitializeShaderOption();
}
void DepthExponentiationPass::FrameBeginInternal(FramePrepareParams params)
{
if (!m_shaderOptionInitialized)
@@ -45,13 +45,16 @@ namespace AZ
explicit DepthExponentiationPass(const RPI::PassDescriptor& descriptor);
// RPI::Pass overrides...
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
// Scope producer functions...
void CompileResources(const RHI::FrameGraphCompileContext& context) override;
void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override;
void InitializeShaderOption();
void SetShaderVariantKeyFallbackValue();
const Name m_optionName;
const AZStd::vector<Name> m_optionValues;
@@ -149,7 +149,7 @@ namespace AZ
// --- Utility functions ---
//! Queues the pass to have Build() and Initilize() called by the PassSystem on frame update
//! Queues the pass to have Build() and Initialize() called by the PassSystem on frame update
void QueueForBuildAndInitialization();
//! Queues the pass to have RemoveFromParent() called by the PassSystem on frame update