Handle DEVICE_REMOVED
- Added DXGI_ERROR_DEVICE_REMOVED handling in dxRenderCommand::SwapBuffers
This commit is contained in:
parent
f9f0d8b649
commit
0fc1896854
1 changed files with 14 additions and 1 deletions
|
@ -16,7 +16,20 @@ namespace Light {
|
|||
|
||||
void dxRenderCommand::SwapBuffers()
|
||||
{
|
||||
m_Context->swapChain->Present(0, 0);
|
||||
#ifdef LIGHT_DEBUG
|
||||
HRESULT hr;
|
||||
if (FAILED(hr = m_Context->swapChain->Present(0u, 0u)))
|
||||
{
|
||||
if (hr == DXGI_ERROR_DEVICE_REMOVED)
|
||||
{
|
||||
LT_ENGINE_CRITICAL("dxRenderCommand::SwapBuffers: DeviceRemoved:");
|
||||
LT_ENGINE_CRITICAL(" {}", m_Context->device->GetDeviceRemovedReason());
|
||||
}
|
||||
}
|
||||
#else
|
||||
m_Context->swapChain->Present(0u, 0u);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void dxRenderCommand::ClearBackBuffer()
|
||||
|
|
Loading…
Add table
Reference in a new issue