Two misc bugfixes:
1) RayTracing will sometimes crash by dereferencing a null ptr. This guards against it. 2) ViewportContext was missing some BusConnect / BusDisconnect calls.
This commit is contained in:
@@ -168,7 +168,7 @@ namespace AZ
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_rayTracingSceneSrg->IsQueuedForCompile())
|
||||
if (!m_rayTracingSceneSrg || m_rayTracingSceneSrg->IsQueuedForCompile())
|
||||
{
|
||||
//[GFX TODO][ATOM-14792] AtomSampleViewer: Reset scene and feature processors before switching to sample
|
||||
return;
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace AZ
|
||||
nativeWindow,
|
||||
&AzFramework::WindowRequestBus::Events::GetClientAreaSize);
|
||||
AzFramework::WindowNotificationBus::Handler::BusConnect(nativeWindow);
|
||||
AzFramework::ViewportRequestBus::Handler::BusConnect(id);
|
||||
|
||||
m_onProjectionMatrixChangedHandler = ViewportContext::MatrixChangedEvent::Handler([this](const AZ::Matrix4x4& matrix)
|
||||
{
|
||||
@@ -48,6 +49,9 @@ namespace AZ
|
||||
|
||||
ViewportContext::~ViewportContext()
|
||||
{
|
||||
AzFramework::WindowNotificationBus::Handler::BusDisconnect();
|
||||
AzFramework::ViewportRequestBus::Handler::BusDisconnect();
|
||||
|
||||
if (m_currentPipeline)
|
||||
{
|
||||
m_currentPipeline->RemoveFromRenderTick();
|
||||
|
||||
Reference in New Issue
Block a user