Matteo Bruni : d3d8/tests: Test a multisampled -> not multisampled depth buffer copy.

Alexandre Julliard julliard at winehq.org
Thu Jan 19 14:56:53 CST 2012


Module: wine
Branch: master
Commit: 922f4696cfd7f59fc567455010d50f41adefa4b8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=922f4696cfd7f59fc567455010d50f41adefa4b8

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Wed Jan 18 23:41:34 2012 +0100

d3d8/tests: Test a multisampled -> not multisampled depth buffer copy.

---

 dlls/d3d8/tests/visual.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c
index dcaa091..e98d71a 100644
--- a/dlls/d3d8/tests/visual.c
+++ b/dlls/d3d8/tests/visual.c
@@ -2373,7 +2373,7 @@ static void shadow_test(IDirect3DDevice8 *device)
 
 static void multisample_copy_rects_test(IDirect3DDevice8 *device)
 {
-    IDirect3DSurface8 *original_ds, *original_rt, *rt, *readback;
+    IDirect3DSurface8 *original_ds, *original_rt, *ds, *ds_plain, *rt, *readback;
     RECT src_rect = {64, 64, 128, 128};
     POINT dst_point = {96, 96};
     D3DLOCKED_RECT locked_rect;
@@ -2395,6 +2395,12 @@ static void multisample_copy_rects_test(IDirect3DDevice8 *device)
     hr = IDirect3DDevice8_CreateRenderTarget(device, 256, 256, D3DFMT_A8R8G8B8,
             D3DMULTISAMPLE_2_SAMPLES, FALSE, &rt);
     ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+    hr = IDirect3DDevice8_CreateDepthStencilSurface(device, 256, 256, D3DFMT_D24S8,
+            D3DMULTISAMPLE_2_SAMPLES, &ds);
+    ok(SUCCEEDED(hr), "Failed to create depth stencil surface, hr %#x.\n", hr);
+    hr = IDirect3DDevice8_CreateDepthStencilSurface(device, 256, 256, D3DFMT_D24S8,
+            D3DMULTISAMPLE_NONE, &ds_plain);
+    ok(SUCCEEDED(hr), "Failed to create depth stencil surface, hr %#x.\n", hr);
     hr = IDirect3DDevice8_CreateImageSurface(device, 256, 256, D3DFMT_A8R8G8B8, &readback);
     ok(SUCCEEDED(hr), "Failed to create readback surface, hr %#x.\n", hr);
 
@@ -2403,15 +2409,18 @@ static void multisample_copy_rects_test(IDirect3DDevice8 *device)
     hr = IDirect3DDevice8_GetDepthStencilSurface(device, &original_ds);
     ok(SUCCEEDED(hr), "Failed to get depth/stencil, hr %#x.\n", hr);
 
-    hr = IDirect3DDevice8_SetRenderTarget(device, rt, NULL);
+    hr = IDirect3DDevice8_SetRenderTarget(device, rt, ds);
     ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr);
 
-    hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0, 0);
+    hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ff00, 1.0f, 0);
     ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
 
     hr = IDirect3DDevice8_CopyRects(device, rt, NULL, 0, readback, NULL);
     ok(SUCCEEDED(hr), "Failed to read render target back, hr %#x.\n", hr);
 
+    hr = IDirect3DDevice8_CopyRects(device, ds, NULL, 0, ds_plain, NULL);
+    todo_wine ok(hr == D3DERR_INVALIDCALL, "Depth buffer copy, hr %#x, expected %#x.\n", hr, D3DERR_INVALIDCALL);
+
     hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0);
     ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
 
@@ -2436,6 +2445,8 @@ static void multisample_copy_rects_test(IDirect3DDevice8 *device)
     IDirect3DSurface8_Release(original_ds);
     IDirect3DSurface8_Release(original_rt);
     IDirect3DSurface8_Release(readback);
+    IDirect3DSurface8_Release(ds_plain);
+    IDirect3DSurface8_Release(ds);
     IDirect3DSurface8_Release(rt);
 }
 




More information about the wine-cvs mailing list