Add better error handling for failed loading of the LyShine shader (#6761)

Signed-off-by: abrmich <abrmich@amazon.com>
This commit is contained in:
michabr
2022-01-10 12:11:15 -08:00
committed by GitHub
parent 73a023b0c3
commit df7a2fbd9d
3 changed files with 34 additions and 23 deletions
+2 -2
View File
@@ -76,7 +76,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene)
// Create a dynamic draw context for UI Canvas drawing for the scene
m_dynamicDraw = CreateDynamicDrawContext(uiShader);
if (m_dynamicDraw)
if (m_dynamicDraw && m_dynamicDraw->IsReady())
{
// Cache shader data such as input indices for later use
CacheShaderData(m_dynamicDraw);
@@ -85,7 +85,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene)
}
else
{
AZ_Error(LogName, false, "Failed to create a dynamic draw context for LyShine. \
AZ_Error(LogName, false, "Failed to create or initialize a dynamic draw context for LyShine. \
This can happen if the LyShine pass hasn't been added to the main render pipeline.");
}
}