Migrate fixes from CodeCommit branch

This commit is contained in:
nvsickle
2021-04-09 12:40:43 -07:00
parent e8f6463db0
commit 1dabb39b98
12 changed files with 94 additions and 154 deletions
@@ -21,7 +21,7 @@ ly_add_target(
Include
COMPILE_DEFINITIONS
PRIVATE
ENABLE_ATOM_DEBUG_DISPLAY=0
ENABLE_ATOM_DEBUG_DISPLAY=1
BUILD_DEPENDENCIES
PUBLIC
AZ::AtomCore
@@ -43,7 +43,7 @@ ly_add_target(
Include
COMPILE_DEFINITIONS
PRIVATE
ENABLE_ATOM_DEBUG_DISPLAY=0
ENABLE_ATOM_DEBUG_DISPLAY=1
BUILD_DEPENDENCIES
PRIVATE
Gem::Atom_AtomBridge.Static
@@ -165,7 +165,7 @@ void CAtomShimRenderer::EF_EndEf3D([[maybe_unused]] const int nFlags, [[maybe_un
// Only render the UI Canvas and the Console on the main window
// If we're not in the editor, don't bother to check viewport.
if (!gEnv->IsEditor() || m_currContext->m_isMainViewport)
if (!gEnv->IsEditor() || m_currContext == nullptr || m_currContext->m_isMainViewport)
{
EBUS_EVENT(AZ::RenderNotificationsBus, OnScene3DEnd);
}
@@ -295,7 +295,12 @@ void CAtomShimRenderer::EndFrame()
if (!m_viewportContext)
{
auto viewContextManager = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
m_viewportContext = viewContextManager->GetViewportContextByName(viewContextManager->GetDefaultViewportContextName());
auto viewportContext = viewContextManager->GetDefaultViewportContext();
// If the viewportContext exists and is created with the default ID, we can safely assume control
if (viewportContext && viewportContext->GetId() == -10)
{
m_viewportContext = viewportContext;
}
}
if (m_viewportContext)