Fix dummy rendering pipeline being created for the Editor

-This ensures OnBootstrapSceneReady still fires even if the bootstrap system component doesn't create a default scene
-This also disables default scene creation for non-game projects by default to ease tools development

Tested with the Editor, AtomSampleViewer, the Material Editor, and the AtomTest launcher
This commit is contained in:
nvsickle
2021-05-19 19:11:23 -07:00
parent f4106fe73f
commit 8d4fb4d67d
3 changed files with 18 additions and 12 deletions
@@ -123,6 +123,12 @@ namespace AZ
m_windowHandle = m_nativeWindow->GetWindowHandle();
}
else
{
// Disable default scene creation for non-games projects
// This can be manually overridden via the DefaultWindowBus.
m_createDefaultScene = false;
}
AzFramework::AssetCatalogEventBus::Handler::BusConnect();
TickBus::Handler::BusConnect();
@@ -351,6 +357,17 @@ namespace AZ
scene->AddRenderPipeline(brdfTexturePipeline);
}
// Send notification when the scene and its pipeline are ready.
// Use the first created pipeline's scene as our default scene for now to allow
// consumers waiting on scene availability to initialize.
if (!m_defaultSceneReady)
{
m_defaultScene = scene;
Render::Bootstrap::NotificationBus::Broadcast(
&Render::Bootstrap::NotificationBus::Handler::OnBootstrapSceneReady, m_defaultScene.get());
m_defaultSceneReady = true;
}
return true;
}
@@ -364,9 +381,6 @@ namespace AZ
{
m_renderPipelineId = pipeline->GetId();
}
// Send notification when the scene and its pipeline are ready
Render::Bootstrap::NotificationBus::Broadcast(&Render::Bootstrap::NotificationBus::Handler::OnBootstrapSceneReady, m_defaultScene.get());
}
void BootstrapSystemComponent::DestroyDefaultScene()