Fixed issue #2982.

This commit is contained in:
Бранимир Караџић 2022-11-30 15:14:40 -08:00
parent 3b9b2aa130
commit 66de825e6f

View File

@ -883,7 +883,20 @@ namespace bgfx { namespace d3d11
errorState = ErrorState::LoadedDXGI;
if (NULL == m_device)
if (NULL != m_device)
{
m_device->AddRef();
m_device->GetImmediateContext(&m_deviceCtx);
if (NULL == m_deviceCtx)
{
BX_TRACE("Init error: Unable to retrieve Direct3D11 ImmediateContext.");
goto error;
}
m_featureLevel = m_device->GetFeatureLevel();
}
else
{
if (NULL != m_renderDocDll)
{
@ -964,18 +977,6 @@ namespace bgfx { namespace d3d11
goto error;
}
}
else
{
m_device->GetImmediateContext(&m_deviceCtx);
if (NULL == m_deviceCtx)
{
BX_TRACE("Init error: Unable to retrieve Direct3D11 ImmediateContext.");
goto error;
}
m_featureLevel = m_device->GetFeatureLevel();
}
m_dxgi.update(m_device);