diff options
author | Anton Fedchin <afedchin@ruswizards.com> | 2016-03-19 17:15:32 +0300 |
---|---|---|
committer | Anton Fedchin <afedchin@ruswizards.com> | 2016-03-21 13:25:53 +0300 |
commit | 0b6c1c61ca60f428477da2f7aa88457ed48e9128 (patch) | |
tree | 4977b642f07db346d9a83eabbb6ccc754f354689 | |
parent | d39953ac49662d17290ba366b2344f44e429ccc0 (diff) |
[RenderSystemDX] fixup: re-create swap chain in mono if switching to stereoscopic 3D mode fails.
-rw-r--r-- | xbmc/rendering/dx/RenderSystemDX.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp index 43a104a629..1f8b1682ac 100644 --- a/xbmc/rendering/dx/RenderSystemDX.cpp +++ b/xbmc/rendering/dx/RenderSystemDX.cpp @@ -852,6 +852,17 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() } m_bHWStereoEnabled = bHWStereoEnabled; } + else if (bHWStereoEnabled) + { + // switch to stereo mode failed, create mono swapchain + CLog::Log(LOGERROR, "%s - Creating swap chain failed with error: %s.", __FUNCTION__, GetErrorDescription(hr).c_str()); + + scDesc1.Stereo = false; + hr = dxgiFactory2->CreateSwapChainForHwnd(m_pD3DDev, m_hFocusWnd, &scDesc1, &scFSDesc, NULL, &m_pSwapChain1); + + // fallback to split_horisontal mode. + g_graphicsContext.SetStereoMode(RENDER_STEREO_MODE_SPLIT_HORIZONTAL); + } dxgiFactory2->Release(); } else |