diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp index e06ffca556..773deafe68 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp @@ -248,6 +248,7 @@ namespace AZ void ParentPass::CreateChildPasses() { + // The already created flag prevents this function from executing multiple times a frame if (!m_flags.m_createChildren || m_flags.m_alreadyCreated) { return; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp index f36673221b..7ae3559e38 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp @@ -42,7 +42,6 @@ namespace AZ { namespace RPI { -#pragma optimize("", off) // --- Constructors --- @@ -1633,8 +1632,6 @@ namespace AZ } } -#pragma optimize("", on) - } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp index d209d03580..ad3d6d31ca 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp @@ -50,7 +50,6 @@ namespace AZ { namespace RPI { -#pragma optimize("", off) PassSystemInterface* PassSystemInterface::Get() { @@ -486,6 +485,5 @@ namespace AZ return nullptr; } -#pragma optimize("", on) } // namespace RPI } // namespace AZ