Restore Editor viewport icon rendering (#879)

This introduces an EditorViewportIconDisplayInterface that will eventually be used to outright remove CIconManager, it provides a simple interface for loading 2D image assets and rendering them on-screen. It also introduces AtomBridge::PerViewportDynamicDraw for getting a dynamic draw instance on a per-viewport basis
This commit is contained in:
Nicholas Van Sickle
2021-05-26 16:36:54 -07:00
committed by GitHub
parent dc0f1ff0b1
commit d1863c6c5b
25 changed files with 1050 additions and 24 deletions
@@ -211,6 +211,42 @@ namespace AZ
m_rhiPipelineState = m_pipelineState->GetRHIPipelineState();
}
void DynamicDrawContext::SetScene(Scene* scene)
{
AZ_Assert(scene, "SetScene called with an invalid scene");
if (!scene || m_scene == scene)
{
return;
}
m_scene = scene;
m_drawFilter = RHI::DrawFilterMaskDefaultValue;
// Reinitialize if it was initialized
if (m_initialized)
{
// Report warning if there were some draw data
AZ_Warning(
"DynamicDrawContext", m_cachedDrawItems.size() == 0,
"DynamicDrawContext::SetForScene should be called"
" when there is no cached draw data");
// Clear some cached data
FrameEnd();
m_cachedRhiPipelineStates.clear();
// Reinitialize
EndInit();
}
}
void DynamicDrawContext::SetRenderPipeline(RenderPipeline* pipeline)
{
AZ_Assert(pipeline, "SetRenderPipeline called with an invalid pipeline");
if (!pipeline)
{
return;
}
SetScene(pipeline->GetScene());
m_drawFilter = pipeline->GetDrawFilterMask();
}
bool DynamicDrawContext::IsReady()
{
return m_initialized;