[RenderSystemDX] fixup: re-create swap chain in mono if switching to stereoscopic...
authorAnton Fedchin <afedchin@ruswizards.com>
Sat, 19 Mar 2016 14:15:32 +0000 (17:15 +0300)
committerAnton Fedchin <afedchin@ruswizards.com>
Mon, 21 Mar 2016 10:25:53 +0000 (13:25 +0300)
xbmc/rendering/dx/RenderSystemDX.cpp

index 43a104a..1f8b168 100644 (file)
@@ -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