From 0b9e98c50e4c7a87b9281990be57fef2421cfcc1 Mon Sep 17 00:00:00 2001 From: antonmic Date: Sat, 22 May 2021 00:27:06 -0700 Subject: [PATCH] Fix for potential lighting pass crash with uninitialized pipeline --- .../CoreLights/LightCullingTilePreparePass.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp index a76467bccd..816ef25bc6 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp @@ -175,12 +175,18 @@ namespace AZ void LightCullingTilePreparePass::OnShaderReinitialized(const AZ::RPI::Shader&) { LoadShader(); - ChooseShaderVariant(); + if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments) + { + ChooseShaderVariant(); + } } void LightCullingTilePreparePass::OnShaderAssetReinitialized(const Data::Asset&) { LoadShader(); - ChooseShaderVariant(); + if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments) + { + ChooseShaderVariant(); + } } void LightCullingTilePreparePass::OnShaderVariantReinitialized( @@ -188,7 +194,10 @@ namespace AZ AZ::RPI::ShaderVariantStableId) { LoadShader(); - ChooseShaderVariant(); + if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments) + { + ChooseShaderVariant(); + } } } // namespace Render