[dx11] Fix: Properly handle DXGI_STATUS_OCCLUDED status, previous method may cause...
authorAnton Fedchin <afedchin@ruswizards.com>
Fri, 29 Jan 2016 14:30:05 +0000 (17:30 +0300)
committerAnton Fedchin <afedchin@ruswizards.com>
Sun, 31 Jan 2016 11:25:49 +0000 (14:25 +0300)
xbmc/rendering/dx/RenderSystemDX.cpp

index 36a6bb4..fe70da9 100644 (file)
@@ -1103,7 +1103,12 @@ bool CRenderSystemDX::PresentRenderImpl(const CDirtyRegionList &dirty)
     return false;
 
   if (m_nDeviceStatus != S_OK)
+  {
+    // if DXGI_STATUS_OCCLUDED occurred we just clear command queue and return
+    if (m_nDeviceStatus == DXGI_STATUS_OCCLUDED)
+      FinishCommandList(false);
     return false;
+  }
 
   if ( m_stereoMode == RENDER_STEREO_MODE_INTERLACED
     || m_stereoMode == RENDER_STEREO_MODE_CHECKERBOARD)
@@ -1201,8 +1206,7 @@ bool CRenderSystemDX::BeginRender()
     if (m_nDeviceStatus != oldStatus)
       CLog::Log(LOGDEBUG, "DXGI_STATUS_OCCLUDED");
     // Status OCCLUDED is not an error and not handled by FAILED macro, 
-    // but if it occurs we should not render anything, so just return false
-    return false;
+    // but if it occurs we should not render anything, this status will be accounted on present stage
   }
 
   if (FAILED(m_nDeviceStatus))