Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h	(revision 43359)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h	(revision 43360)
@@ -576,4 +576,6 @@
         case D3DDDIFMT_INDEX32:
             return 8;
+        case D3DDDIFMT_R32F:
+            return 32;
         default:
             AssertBreakpoint();
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp	(revision 43359)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp	(revision 43360)
@@ -427,119 +427,6 @@
     HRESULT hr = E_FAIL;
     IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
-    if (pRc->RcDesc.fFlags.ZBuffer)
-    {
-        for (UINT i = 0; i < pRc->cAllocations; ++i)
-        {
-            PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
-            IDirect3DSurface9 *pD3D9Surf;
-            hr = pDevice9If->CreateDepthStencilSurface(pAllocation->SurfDesc.width,
-                    pAllocation->SurfDesc.height,
-                    vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
-                    vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType),
-                    pRc->RcDesc.MultisampleQuality,
-                    TRUE /* @todo: BOOL Discard */,
-                    &pD3D9Surf,
-                    NULL /*HANDLE* pSharedHandle*/);
-            Assert(hr == S_OK);
-            if (hr == S_OK)
-            {
-                Assert(pD3D9Surf);
-                pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE;
-                pAllocation->pD3DIf = pD3D9Surf;
-            }
-            else
-            {
-                for (UINT j = 0; j < i; ++j)
-                {
-                    pRc->aAllocations[j].pD3DIf->Release();
-                }
-                break;
-            }
-        }
-
-        if (SUCCEEDED(hr))
-        {
-            if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
-            {
-                vboxDispD3DIfSurfSynchMem(pRc);
-            }
-        }
-    }
-    else if (pRc->RcDesc.fFlags.VertexBuffer)
-    {
-        for (UINT i = 0; i < pRc->cAllocations; ++i)
-        {
-            PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
-            IDirect3DVertexBuffer9  *pD3D9VBuf;
-            hr = pDevice9If->CreateVertexBuffer(pAllocation->SurfDesc.width,
-                    vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
-                    pRc->RcDesc.Fvf,
-                    vboxDDI2D3DPool(pRc->RcDesc.enmPool),
-                    &pD3D9VBuf,
-                    NULL /*HANDLE* pSharedHandle*/);
-            Assert(hr == S_OK);
-            if (hr == S_OK)
-            {
-                Assert(pD3D9VBuf);
-                pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_VERTEXBUFFER;
-                pAllocation->pD3DIf = pD3D9VBuf;
-            }
-            else
-            {
-                for (UINT j = 0; j < i; ++j)
-                {
-                    pRc->aAllocations[j].pD3DIf->Release();
-                }
-                break;
-            }
-        }
-
-        if (SUCCEEDED(hr))
-        {
-            if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
-            {
-                vboxDispD3DIfSurfSynchMem(pRc);
-            }
-        }
-    }
-    else if (pRc->RcDesc.fFlags.IndexBuffer)
-    {
-        for (UINT i = 0; i < pRc->cAllocations; ++i)
-        {
-            PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
-            IDirect3DIndexBuffer9  *pD3D9IBuf;
-            hr = pDevice9If->CreateIndexBuffer(pAllocation->SurfDesc.width,
-                    vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
-                    vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
-                    vboxDDI2D3DPool(pRc->RcDesc.enmPool),
-                    &pD3D9IBuf,
-                    NULL /*HANDLE* pSharedHandle*/
-                  );
-            Assert(hr == S_OK);
-            if (hr == S_OK)
-            {
-                Assert(pD3D9IBuf);
-                pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_INDEXBUFFER;
-                pAllocation->pD3DIf = pD3D9IBuf;
-            }
-            else
-            {
-                for (UINT j = 0; j < i; ++j)
-                {
-                    pRc->aAllocations[j].pD3DIf->Release();
-                }
-                break;
-            }
-        }
-
-        if (SUCCEEDED(hr))
-        {
-            if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
-            {
-                vboxDispD3DIfSurfSynchMem(pRc);
-            }
-        }
-    }
-    else if (VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags))
+
+    if (VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags))
     {
         PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
@@ -777,4 +664,118 @@
         }
     }
+    else if (pRc->RcDesc.fFlags.ZBuffer)
+    {
+        for (UINT i = 0; i < pRc->cAllocations; ++i)
+        {
+            PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
+            IDirect3DSurface9 *pD3D9Surf;
+            hr = pDevice9If->CreateDepthStencilSurface(pAllocation->SurfDesc.width,
+                    pAllocation->SurfDesc.height,
+                    vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
+                    vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType),
+                    pRc->RcDesc.MultisampleQuality,
+                    TRUE /* @todo: BOOL Discard */,
+                    &pD3D9Surf,
+                    NULL /*HANDLE* pSharedHandle*/);
+            Assert(hr == S_OK);
+            if (hr == S_OK)
+            {
+                Assert(pD3D9Surf);
+                pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_SURFACE;
+                pAllocation->pD3DIf = pD3D9Surf;
+            }
+            else
+            {
+                for (UINT j = 0; j < i; ++j)
+                {
+                    pRc->aAllocations[j].pD3DIf->Release();
+                }
+                break;
+            }
+        }
+
+        if (SUCCEEDED(hr))
+        {
+            if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
+            {
+                vboxDispD3DIfSurfSynchMem(pRc);
+            }
+        }
+    }
+    else if (pRc->RcDesc.fFlags.VertexBuffer)
+    {
+        for (UINT i = 0; i < pRc->cAllocations; ++i)
+        {
+            PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
+            IDirect3DVertexBuffer9  *pD3D9VBuf;
+            hr = pDevice9If->CreateVertexBuffer(pAllocation->SurfDesc.width,
+                    vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
+                    pRc->RcDesc.Fvf,
+                    vboxDDI2D3DPool(pRc->RcDesc.enmPool),
+                    &pD3D9VBuf,
+                    NULL /*HANDLE* pSharedHandle*/);
+            Assert(hr == S_OK);
+            if (hr == S_OK)
+            {
+                Assert(pD3D9VBuf);
+                pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_VERTEXBUFFER;
+                pAllocation->pD3DIf = pD3D9VBuf;
+            }
+            else
+            {
+                for (UINT j = 0; j < i; ++j)
+                {
+                    pRc->aAllocations[j].pD3DIf->Release();
+                }
+                break;
+            }
+        }
+
+        if (SUCCEEDED(hr))
+        {
+            if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
+            {
+                vboxDispD3DIfSurfSynchMem(pRc);
+            }
+        }
+    }
+    else if (pRc->RcDesc.fFlags.IndexBuffer)
+    {
+        for (UINT i = 0; i < pRc->cAllocations; ++i)
+        {
+            PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
+            IDirect3DIndexBuffer9  *pD3D9IBuf;
+            hr = pDevice9If->CreateIndexBuffer(pAllocation->SurfDesc.width,
+                    vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
+                    vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
+                    vboxDDI2D3DPool(pRc->RcDesc.enmPool),
+                    &pD3D9IBuf,
+                    NULL /*HANDLE* pSharedHandle*/
+                  );
+            Assert(hr == S_OK);
+            if (hr == S_OK)
+            {
+                Assert(pD3D9IBuf);
+                pAllocation->enmD3DIfType = VBOXDISP_D3DIFTYPE_INDEXBUFFER;
+                pAllocation->pD3DIf = pD3D9IBuf;
+            }
+            else
+            {
+                for (UINT j = 0; j < i; ++j)
+                {
+                    pRc->aAllocations[j].pD3DIf->Release();
+                }
+                break;
+            }
+        }
+
+        if (SUCCEEDED(hr))
+        {
+            if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
+            {
+                vboxDispD3DIfSurfSynchMem(pRc);
+            }
+        }
+    }
     else
     {
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.h	(revision 43359)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.h	(revision 43360)
@@ -104,5 +104,4 @@
         case VBOXDISP_D3DIFTYPE_CUBE_TEXTURE:
         {
-            Assert(0);
             IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pD3DIf;
             IDirect3DSurface9 *pSurfaceLevel;
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 43359)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 43360)
@@ -5030,14 +5030,28 @@
     PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hZBuffer;
     IDirect3DSurface9 *pD3D9Surf = NULL;
+    HRESULT hr = S_OK;
     if (pRc)
     {
         VBOXVDBG_CHECK_SMSYNC(pRc);
         Assert(pRc->cAllocations == 1);
-        Assert(pRc->aAllocations[0].enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE);
-        pD3D9Surf = (IDirect3DSurface9*)pRc->aAllocations[0].pD3DIf;
-        Assert(pD3D9Surf);
-    }
-    HRESULT hr = pDevice9If->SetDepthStencilSurface(pD3D9Surf);
-    Assert(hr == S_OK);
+        hr = VBoxD3DIfSurfGet(pRc, 0, &pD3D9Surf);
+        if (FAILED(hr))
+            WARN(("VBoxD3DIfSurfGet failed, hr (0x%x)",hr));
+        else
+            Assert(pD3D9Surf);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+        hr = pDevice9If->SetDepthStencilSurface(pD3D9Surf);
+        if (SUCCEEDED(hr))
+            hr = S_OK;
+        else
+            WARN(("VBoxD3DIfSurfGet failed, hr (0x%x)",hr));
+
+        if (pD3D9Surf)
+            pD3D9Surf->Release();
+    }
+
     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr));
     return hr;
