I'm really stumped on why this even works because after writing a test
(attached) and running on windows it shows that ppZStencilSurface IS
getting set to null when D3DERR_NOTFOUND is returned.

Could it be that there is something else behind this problem which is
unrelated to what I have been looking at?

Regards,
Andrew

On Sat, Aug 30, 2008 at 1:05 AM, Stefan Dösinger <[EMAIL PROTECTED]> wrote:
>> When IWineD3DDevice_GetDepthStencilSurface returns WINED3DERR_NOTFOUND
>> it was setting ppZStencilSurface to null. This was the cause of
>> rendering issues with the 3d models in spore.
> Can you write a test for this? I think we have some depth stencil tests in 
> dlls/d3d9/tests/device.c which you could use to test this.
>
> I think you are right with this patch - I vaguely remember writing a test for 
> a different getter function, but it is better to be sure
>
>
>
>
>
From ab5a81737978258512798520f074cd0759726067 Mon Sep 17 00:00:00 2001
From: Andrew Fenn <[EMAIL PROTECTED]>
Date: Sat, 30 Aug 2008 23:36:19 +0700
Subject: Test to see if IDirect3DSurface9 is set to null after returning D3DERR_NOTFOUND

---
 dlls/d3d9/tests/device.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 3164b81..bf90cfe 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -1364,6 +1364,13 @@ static void test_depthstenciltest(void)
     ok(hr == D3DERR_NOTFOUND && pDepthStencil2 == NULL, "IDirect3DDevice9_GetDepthStencilSurface failed with %08x\n", hr);
     if(pDepthStencil2) IDirect3DSurface9_Release(pDepthStencil2);
 
+    hr = IDirect3DDevice9_CreateDepthStencilSurface(pDevice, 800, 600, D3DFMT_D16, D3DMULTISAMPLE_NONE, 0, FALSE, &pDepthStencil2, NULL);
+    ok(hr == D3D_OK && pDepthStencil2 != NULL, "IDirect3DDevice9_CreateDepthStencilSurface failed with %08x\n", hr);
+
+    hr = IDirect3DDevice9_GetDepthStencilSurface(pDevice, &pDepthStencil2);
+    ok(hr == D3DERR_NOTFOUND && pDepthStencil2 == NULL, "IDirect3DDevice9_GetDepthStencilSurface failed with %08x pDepthStencil (%08x)\n", hr, pDepthStencil2);
+    if(pDepthStencil2) IDirect3DSurface9_Release(pDepthStencil2);
+
     /* This left the render states untouched! */
     hr = IDirect3DDevice9_GetRenderState(pDevice, D3DRS_ZENABLE, &state);
     ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed with %08x\n", hr);
-- 
1.5.4.3



Reply via email to