[PATCH 1/4] d3d9/tests: Avoid invalid framebuffer configrations in resz_test.

Stefan Dösinger stefan at codeweavers.com
Sat May 16 08:29:12 CDT 2015


The test combines multisampled and non-multisampled surfaces in one of
the readback draws and one of the dummy draws. Right now we set depth
location == color location, so GL doesn't mind, but we use the wrong
buffer. Patch 4 will change this and cause failing draws.

I suspect native d3d9 behaves as if no depth buffer is set in this case.
Unless we spot an app that depends on this I think it is best to change
the test to avoid this corner case.

The d3d8 test doesn't need these fixes. Because d3d8 sets the color and
depth surfaces with one call the test already sets valid combinations.
---
 dlls/d3d9/tests/visual.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 23050d6..cc5921e 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -15544,6 +15544,8 @@ static void resz_test(void)
 
     hr = IDirect3DDevice9_SetRenderTarget(device, 0, original_rt);
     ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr);
+    hr = IDirect3DDevice9_SetDepthStencilSurface(device, NULL);
+    ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);
     hr = IDirect3DDevice9_SetPixelShader(device, ps);
     ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr);
 
@@ -15564,10 +15566,6 @@ static void resz_test(void)
     hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
     ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr);
 
-    hr = IDirect3DDevice9_SetRenderTarget(device, 0, original_rt);
-    ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr);
-    hr = IDirect3DDevice9_SetDepthStencilSurface(device, NULL);
-    ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);
     IDirect3DSurface9_Release(ds);
     hr = IDirect3DDevice9_SetTexture(device, 0, NULL);
     ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr);
@@ -15580,7 +15578,6 @@ static void resz_test(void)
     IDirect3DSurface9_Release(rt);
     cleanup_device(device);
 
-
     ZeroMemory(&present_parameters, sizeof(present_parameters));
     present_parameters.Windowed = TRUE;
     present_parameters.hDeviceWindow = create_window();
@@ -15682,6 +15679,8 @@ static void resz_test(void)
 
     hr = IDirect3DDevice9_SetRenderTarget(device, 0, readback);
     ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr);
+    hr = IDirect3DDevice9_SetDepthStencilSurface(device, NULL);
+    ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);
     hr = IDirect3DDevice9_SetPixelShader(device, ps);
     ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr);
 
@@ -15710,6 +15709,10 @@ static void resz_test(void)
     ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr);
     hr = IDirect3DDevice9_SetTexture(device, 0, NULL);
     ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr);
+    hr = IDirect3DDevice9_SetDepthStencilSurface(device, ds);
+    ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);
+    hr = IDirect3DDevice9_SetRenderTarget(device, 0, original_rt);
+    ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);
 
     hr = IDirect3DDevice9_BeginScene(device);
     ok(SUCCEEDED(hr), "BeginScene failed, hr %#x.\n", hr);
-- 
2.3.6




More information about the wine-patches mailing list