Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 38983)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 38988)
@@ -2173,92 +2173,4 @@
 }
 
-
-#if 0
-
-
-DECLINLINE(VOID) vboxWddmSwapchainSetBb(PVBOXWDDMDISP_SWAPCHAIN pSwapchain, PVBOXWDDMDISP_RENDERTGT pRT)
-{
-    UINT iRt = vboxWddmSwapchainRtIndex(pSwapchain, pRT);
-    Assert(iRt < pSwapchain->cRTs);
-    pSwapchain->iBB = iRt;
-}
-
-/* the paRemoved buffer should at least contain VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE elements,
- * the function does not validate its size in any way */
-static BOOL vboxWddmSwapchainAdjust(PVBOXWDDMDISP_SWAPCHAIN pSwapchain, PVBOXWDDMDISP_ALLOCATION pBbAlloc, PUINT pcRemoved, PVBOXWDDMDISP_ALLOCATION paRemoved)
-{
-    UINT cRemoved = 0;
-    BOOL bChanged = FALSE;
-    PVBOXWDDMDISP_RENDERTGT pCurBbRt = vboxWddmSwapchainGetBb(pSwapchain);
-    if (pCurBb)
-    {
-        if (pCurBbRt->pAlloc != pBbAlloc)
-        {
-            bChanged = TRUE;
-
-            /* determine whether we need to add the current BB
-             * or remove part or all of the current RTs in the swapchain */
-            PVBOXWDDMDISP_RENDERTGT pCorrectRt = vboxWddmSwapchainSearchRt(pSwapchain, pBbAlloc);
-            if (pCorrectRt)
-            {
-                paRemoved[cRemoved] = pCurBbRt->pAlloc;
-                ++cRemoved;
-                vboxWddmSwapchainRemoveRt(pSwapchain, pCurBbRt);
-                vboxWddmSwapchainSetBb(pSwapchain, pBbAlloc);
-            }
-            else
-            {
-                /* check if the pCurBbRt stored in the swapchain match those of the pBbAlloc */
-                if (pBbAlloc->SurfDesc.width == pCurBbRt->pAlloc->SurfDesc.width
-                        && pBbAlloc->SurfDesc.height == pCurBbRt->pAlloc->SurfDesc.height
-                        && pBbAlloc->SurfDesc.format == pCurBbRt->pAlloc->SurfDesc.format)
-                {
-                    for (UINT i = 0; i < pSwapchain->cRTs;)
-                    {
-                        if (pSwapchain->aRTs[i].cNumFlips > 1)
-                        {
-                            paRemoved[cRemoved] = pSwapchain->aRTs[i].pAlloc;
-                            ++cRemoved;
-                            vboxWddmSwapchainRemoveRt(pSwapchain, &pSwapchain->aRTs[i]);
-                        }
-                        else
-                        {
-                            ++i;
-                        }
-                    }
-                }
-                else
-                {
-                    /* remove all */
-                    for (UINT i = 0; i < pSwapchain->cRTs; ++i)
-                    {
-                        paRemoved[cRemoved] = pSwapchain->aRTs[i].pAlloc;
-                        ++cRemoved;
-                    }
-
-                    vboxWddmSwapchainClear(pSwapchain);
-                }
-
-                vboxWddmSwapchainAllocAddTail(pSwapchain, pBbAlloc);
-                vboxWddmSwapchainSetBb(pSwapchain, pBbAlloc);
-            }
-        }
-    }
-    else
-    {
-        vboxWddmSwapchainAllocAddTail(pSwapchain, pBbAlloc);
-        bChanged = TRUE;
-    }
-
-    if (!bChanged)
-    {
-        Assert(cRemoved == 0);
-    }
-
-    *pcRemoved = cRemoved;
-
-    return bChanged;
-}
-#endif
 static PVBOXWDDMDISP_SWAPCHAIN vboxWddmSwapchainFindCreate(PVBOXWDDMDISP_DEVICE pDevice, PVBOXWDDMDISP_ALLOCATION pBbAlloc, BOOL *pbNeedPresent)
 {
@@ -2389,6 +2301,5 @@
     PVBOXWDDMDISP_ALLOCATION pAlloc = pRt->pAlloc;
     Assert(pD3D9Surf);
-    Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE
-            || pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_TEXTURE);
+    Assert(pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE);
     if (pAlloc->pD3DIf)
     {
@@ -2781,4 +2692,15 @@
         fNeedRtPresentSwitch = TRUE;
 //        vboxWddmSwapchainSwtichRtPresent(pDevice, pSwapchain);
+    }
+    else
+    {
+        for (UINT i = 0; i < pSwapchain->cRTs; ++i)
+        {
+            if (pSwapchain->aRTs[i].pAlloc->enmD3DIfType != VBOXDISP_D3DIFTYPE_SURFACE)
+            {
+                fNeedRtPresentSwitch = TRUE;
+                break;
+            }
+        }
     }
 
