From: Anton Fedchin Date: Sat, 19 Mar 2016 14:15:32 +0000 (+0300) Subject: [RenderSystemDX] fixup: re-create swap chain in mono if switching to stereoscopic... X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_xbmc;a=commitdiff_plain;h=0b6c1c61ca60f428477da2f7aa88457ed48e9128 [RenderSystemDX] fixup: re-create swap chain in mono if switching to stereoscopic 3D mode fails. --- diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp index 43a104a..1f8b168 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