Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.cpp	(revision 102795)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.cpp	(revision 102809)
@@ -589,5 +589,5 @@
                                                       pResource->AllocationDesc.surfaceInfo.numMipLevels,
                                                       pResource->AllocationDesc.surfaceInfo.arraySize,
-                                                      1);
+                                                      pResource->AllocationDesc.surfaceInfo.multisampleCount);
 }
 
@@ -662,6 +662,6 @@
         f |= SVGA3D_SURFACE_RESOURCE_CLAMP;
 
-    /** @todo SVGA3D_SURFACE_MULTISAMPLE */
-    Assert(pCreateResource->SampleDesc.Count <= 1);
+    if (pCreateResource->SampleDesc.Count > 1)
+        f |= SVGA3D_SURFACE_MULTISAMPLE;
 
     return f;
@@ -704,7 +704,15 @@
     pDesc->surfaceInfo.format             = vboxDXDxgiToSvgaFormat(pCreateResource->Format);
     pDesc->surfaceInfo.numMipLevels       = pCreateResource->MipLevels;
-    pDesc->surfaceInfo.multisampleCount   = 0;
-    pDesc->surfaceInfo.multisamplePattern = SVGA3D_MS_PATTERN_NONE;
-    pDesc->surfaceInfo.qualityLevel       = SVGA3D_MS_QUALITY_NONE;
+    pDesc->surfaceInfo.multisampleCount   = pCreateResource->SampleDesc.Count;
+    if (pDesc->surfaceInfo.multisampleCount > 1)
+    {
+        pDesc->surfaceInfo.multisamplePattern = SVGA3D_MS_PATTERN_STANDARD;
+        pDesc->surfaceInfo.qualityLevel       = SVGA3D_MS_QUALITY_FULL;
+    }
+    else
+    {
+        pDesc->surfaceInfo.multisamplePattern = SVGA3D_MS_PATTERN_NONE;
+        pDesc->surfaceInfo.qualityLevel       = SVGA3D_MS_QUALITY_NONE;
+    }
     pDesc->surfaceInfo.autogenFilter      = SVGA3D_TEX_FILTER_NONE;
     pDesc->surfaceInfo.size.width         = pCreateResource->pMipInfoList[0].TexelWidth;
@@ -3112,4 +3120,12 @@
 
 
+void vboxDXResourceResolveSubresource(PVBOXDX_DEVICE pDevice, PVBOXDX_RESOURCE pDstResource, UINT DstSubresource,
+                                      PVBOXDX_RESOURCE pSrcResource, UINT SrcSubresource, DXGI_FORMAT ResolveFormat)
+{
+    SVGA3dSurfaceFormat const copyFormat = vboxDXDxgiToSvgaFormat(ResolveFormat);
+    vgpu10ResolveCopy(pDevice, vboxDXGetAllocation(pDstResource), DstSubresource,
+                      vboxDXGetAllocation(pSrcResource), SrcSubresource, copyFormat);
+}
+
 static void vboxDXUndefineResourceViews(PVBOXDX_DEVICE pDevice, PVBOXDX_RESOURCE pResource)
 {
@@ -3648,5 +3664,5 @@
 {
     AssertReturn(Rotate == DXGI_DDI_MODE_ROTATION_IDENTITY, DXGI_ERROR_INVALID_CALL);
-    AssertReturn(Flags.Resolve == 0, DXGI_ERROR_INVALID_CALL);
+    AssertReturn(Flags.Resolve == 0, DXGI_ERROR_INVALID_CALL); /** @todo Multisampled resources. */
 
     SVGA3dBox boxSrc;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.h	(revision 102795)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDX.h	(revision 102809)
@@ -724,4 +724,6 @@
                               const D3D10_DDI_BOX *pSrcBox, UINT CopyFlags);
 void vboxDXResourceCopy(PVBOXDX_DEVICE pDevice, PVBOXDX_RESOURCE pDstResource, PVBOXDX_RESOURCE pSrcResource);
+void vboxDXResourceResolveSubresource(PVBOXDX_DEVICE pDevice, PVBOXDX_RESOURCE pDstResource, UINT DstSubresource,
+                                      PVBOXDX_RESOURCE pSrcResource, UINT SrcSubresource, DXGI_FORMAT ResolveFormat);
 void vboxDXCreateUnorderedAccessView(PVBOXDX_DEVICE pDevice, PVBOXDXUNORDEREDACCESSVIEW pUnorderedAccessView);
 void vboxDXDestroyUnorderedAccessView(PVBOXDX_DEVICE pDevice, PVBOXDXUNORDEREDACCESSVIEW pUnorderedAccessView);
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXCmd.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXCmd.cpp	(revision 102795)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXCmd.cpp	(revision 102809)
@@ -1259,4 +1259,33 @@
 
 
+int vgpu10ResolveCopy(PVBOXDX_DEVICE pDevice,
+                      D3DKMT_HANDLE hDstAllocation,
+                      uint32 dstSubResource,
+                      D3DKMT_HANDLE hSrcAllocation,
+                      uint32 srcSubResource,
+                      SVGA3dSurfaceFormat copyFormat)
+{
+    void *pvCmd = vboxDXCommandBufferReserve(pDevice, SVGA_3D_CMD_DX_RESOLVE_COPY,
+                                             sizeof(SVGA3dCmdDXResolveCopy), 2);
+    if (!pvCmd)
+        return VERR_NO_MEMORY;
+
+    SVGA3dCmdDXResolveCopy *cmd = (SVGA3dCmdDXResolveCopy *)pvCmd;
+    cmd->dstSid = SVGA3D_INVALID_ID;
+    SET_CMD_FIELD(dstSubResource);
+    cmd->srcSid = SVGA3D_INVALID_ID;
+    SET_CMD_FIELD(srcSubResource);
+    SET_CMD_FIELD(copyFormat);
+
+    vboxDXStorePatchLocation(pDevice, &cmd->dstSid, VBOXDXALLOCATIONTYPE_SURFACE,
+                             hDstAllocation, 0, true);
+    vboxDXStorePatchLocation(pDevice, &cmd->srcSid, VBOXDXALLOCATIONTYPE_SURFACE,
+                             hSrcAllocation, 0, false);
+
+    vboxDXCommandBufferCommit(pDevice);
+    return VINF_SUCCESS;
+}
+
+
 int vgpu10MobFence64(PVBOXDX_DEVICE pDevice,
                      uint64 value,
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXCmd.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXCmd.h	(revision 102795)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXCmd.h	(revision 102809)
@@ -262,4 +262,10 @@
                        D3DKMT_HANDLE hDstAllocation,
                        D3DKMT_HANDLE hSrcAllocation);
+int vgpu10ResolveCopy(PVBOXDX_DEVICE pDevice,
+                      D3DKMT_HANDLE hDstAllocation,
+                      uint32 dstSubResource,
+                      D3DKMT_HANDLE hSrcAllocation,
+                      uint32 srcSubResource,
+                      SVGA3dSurfaceFormat copyFormat);
 int vgpu10MobFence64(PVBOXDX_DEVICE pDevice,
                      uint64 value,
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXDDI.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXDDI.cpp	(revision 102795)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/dx/VBoxDXDDI.cpp	(revision 102809)
@@ -1127,5 +1127,5 @@
 }
 
-void APIENTRY vboxDXResourceResolveSubresource(
+static void APIENTRY ddi10ResourceResolveSubresource(
     D3D10DDI_HDEVICE hDevice,
     D3D10DDI_HRESOURCE hDstResource, // A handle to the destination resource to resolve to. This resource must have been created as D3D10_USAGE_DEFAULT and single sampled.
@@ -1136,7 +1136,13 @@
 )
 {
-    DEBUG_BREAKPOINT_TEST();
-    RT_NOREF(hDevice, hDstResource, DstSubresource, hSrcResource, SrcSubresource, ResolveFormat);
-    LogFlowFuncEnter();
+    //DEBUG_BREAKPOINT_TEST();
+    PVBOXDX_DEVICE pDevice = (PVBOXDX_DEVICE)hDevice.pDrvPrivate;
+    PVBOXDX_RESOURCE pDstResource = (PVBOXDX_RESOURCE)hDstResource.pDrvPrivate;
+    PVBOXDX_RESOURCE pSrcResource = (PVBOXDX_RESOURCE)hSrcResource.pDrvPrivate;
+    LogFlowFunc(("pDevice 0x%p, pDstResource 0x%p, pSrcResource 0x%p",
+                 pDevice, pDstResource, pSrcResource));
+
+    vboxDXResourceResolveSubresource(pDevice, pDstResource, DstSubresource,
+                                     pSrcResource, SrcSubresource, ResolveFormat);
 }
 
@@ -1840,5 +1846,5 @@
     PVBOXDX_DEVICE pDevice = (PVBOXDX_DEVICE)hDevice.pDrvPrivate;
     PVBOXDX_BLENDSTATE pBlendState = (PVBOXDX_BLENDSTATE)hBlendState.pDrvPrivate;
-    LogFlowFunc(("pDevice 0x%p, pBlendState 0x%p, RT[0] BlendEnable %d", pDevice, pBlendState, pBlendDesc->RenderTarget[0].BlendEnable));
+    LogFlowFunc(("pDevice 0x%p, pBlendState 0x%p, RT[0] BlendEnable %d\n", pDevice, pBlendState, pBlendDesc->RenderTarget[0].BlendEnable));
 
     /* Init the blend state and allocate blend id. */
@@ -1859,5 +1865,5 @@
     PVBOXDX_DEVICE pDevice = (PVBOXDX_DEVICE)hDevice.pDrvPrivate;
     PVBOXDX_BLENDSTATE pBlendState = (PVBOXDX_BLENDSTATE)hBlendState.pDrvPrivate;
-    LogFlowFunc(("pDevice 0x%p, pBlendState 0x%p, RT[0] BlendEnable %d", pDevice, pBlendState, pBlendDesc->RenderTarget[0].BlendEnable));
+    LogFlowFunc(("pDevice 0x%p, pBlendState 0x%p, RT[0] BlendEnable %d\n", pDevice, pBlendState, pBlendDesc->RenderTarget[0].BlendEnable));
 
     /* Init the blend state and allocate blend id. */
@@ -2771,4 +2777,7 @@
             if (u32Cap & SVGA3D_DXFMT_ARRAY)
             if (u32Cap & SVGA3D_DXFMT_VOLUME)*/
+
+            if (u32Cap & SVGA3D_DXFMT_MULTISAMPLE)
+                *pFormatCaps |= D3D10_DDI_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET;
         }
     } else {
@@ -2786,11 +2795,31 @@
     //DEBUG_BREAKPOINT_TEST();
     PVBOXDX_DEVICE pDevice = (PVBOXDX_DEVICE)hDevice.pDrvPrivate;
-    RT_NOREF(pDevice, Format, SampleCount, pNumQualityLevels);
- //   LogFlowFunc(("pDevice 0x%p, Format %d, SampleCount %d", pDevice, Format, SampleCount));
+    //LogFlowFunc(("pDevice 0x%p, Format %d, SampleCount %d", pDevice, Format, SampleCount));
 
     if (SampleCount == 1)
         *pNumQualityLevels = 1;
     else
+    {
         *pNumQualityLevels = 0;
+
+        SVGA3dDevCapIndex const idxDevCap = vboxDXGIFormat2CapIdx(Format);
+        if (idxDevCap != SVGA3D_DEVCAP_INVALID)
+        {
+            PVBOXDXADAPTER pVBoxAdapter = pDevice->pAdapter;
+            uint32_t const *au32Caps = pVBoxAdapter->AdapterInfo.u.vmsvga.HWInfo.u.svga.au32Caps;
+            uint32_t const u32Cap = au32Caps[idxDevCap];
+            if (u32Cap & SVGA3D_DXFMT_MULTISAMPLE)
+            {
+                bool fSampleCountSupported = false;
+                if (SampleCount == 2)
+                   fSampleCountSupported = RT_BOOL(au32Caps[SVGA3D_DEVCAP_MULTISAMPLE_2X]);
+                else if (SampleCount == 4)
+                   fSampleCountSupported = RT_BOOL(au32Caps[SVGA3D_DEVCAP_MULTISAMPLE_4X]);
+                else if (SampleCount == 8)
+                   fSampleCountSupported = RT_BOOL(au32Caps[SVGA3D_DEVCAP_MULTISAMPLE_8X]);
+                *pNumQualityLevels = fSampleCountSupported ? 1 : 0;
+            }
+        }
+    }
 }
 
@@ -4129,5 +4158,5 @@
         p11_1DeviceFuncs->pfnGenMips                                   = ddi10GenMips;
         p11_1DeviceFuncs->pfnResourceCopy                              = ddi10ResourceCopy;
-        p11_1DeviceFuncs->pfnResourceResolveSubresource                = vboxDXResourceResolveSubresource;
+        p11_1DeviceFuncs->pfnResourceResolveSubresource                = ddi10ResourceResolveSubresource;
 
         /* Infrequent paths. */
@@ -4306,5 +4335,5 @@
         p11DeviceFuncs->pfnGenMips                                   = ddi10GenMips;
         p11DeviceFuncs->pfnResourceCopy                              = ddi10ResourceCopy;
-        p11DeviceFuncs->pfnResourceResolveSubresource                = vboxDXResourceResolveSubresource;
+        p11DeviceFuncs->pfnResourceResolveSubresource                = ddi10ResourceResolveSubresource;
 
         /* Infrequent paths. */
@@ -4476,5 +4505,5 @@
         p10_1DeviceFuncs->pfnGenMips                                   = ddi10GenMips;
         p10_1DeviceFuncs->pfnResourceCopy                              = ddi10ResourceCopy;
-        p10_1DeviceFuncs->pfnResourceResolveSubresource                = vboxDXResourceResolveSubresource;
+        p10_1DeviceFuncs->pfnResourceResolveSubresource                = ddi10ResourceResolveSubresource;
 
         /* Infrequent paths. */
@@ -4597,5 +4626,5 @@
         p10DeviceFuncs->pfnGenMips                                   = ddi10GenMips;
         p10DeviceFuncs->pfnResourceCopy                              = ddi10ResourceCopy;
-        p10DeviceFuncs->pfnResourceResolveSubresource                = vboxDXResourceResolveSubresource;
+        p10DeviceFuncs->pfnResourceResolveSubresource                = ddi10ResourceResolveSubresource;
 
         /* Infrequent paths. */
