Module: wine Branch: master Commit: 33eb939390e8782c7512a174bd0b210aa3b896a4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=33eb939390e8782c7512a174bd...
Author: David Adam david.adam.cnrs@gmail.com Date: Thu Apr 23 08:33:21 2009 +0200
wined3d: SetDepthStencilSurface is always called when AutoDepthStencil is enabled.
---
dlls/d3d8/tests/device.c | 6 +++--- dlls/d3d9/tests/device.c | 6 +++--- dlls/wined3d/device.c | 21 +++++++++++++++++++-- 3 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 6f410fd..0cd741d 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -1388,13 +1388,13 @@ static void test_depth_stencil_reset(void) present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8;
hr = IDirect3DDevice8_Reset(device, &present_parameters); - todo_wine ok(hr == D3D_OK, "IDirect3DDevice8_Reset failed with 0x%08x\n", hr); + ok(hr == D3D_OK, "IDirect3DDevice8_Reset failed with 0x%08x\n", hr);
if (FAILED(hr)) goto cleanup;
hr = IDirect3DDevice8_GetDepthStencilSurface(device, &surface); - todo_wine ok(hr == D3D_OK, "GetDepthStencilSurface failed with 0x%08x\n", hr); - todo_wine ok(surface != NULL, "Depth stencil should not be NULL\n"); + ok(hr == D3D_OK, "GetDepthStencilSurface failed with 0x%08x\n", hr); + ok(surface != NULL, "Depth stencil should not be NULL\n"); if (surface) IDirect3DSurface8_Release(surface);
cleanup: diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index fe4318e..2f5bbc8 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1079,13 +1079,13 @@ static void test_reset(void) d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
hr = IDirect3DDevice9_Reset(pDevice, &d3dpp); - todo_wine ok(hr == D3D_OK, "IDirect3DDevice9_Reset failed with 0x%08x\n", hr); + ok(hr == D3D_OK, "IDirect3DDevice9_Reset failed with 0x%08x\n", hr);
if (FAILED(hr)) goto cleanup;
hr = IDirect3DDevice9_GetDepthStencilSurface(pDevice, &surface); - todo_wine ok(hr == D3D_OK, "GetDepthStencilSurface failed with 0x%08x\n", hr); - todo_wine ok(surface != NULL, "Depth stencil should not be NULL\n"); + ok(hr == D3D_OK, "GetDepthStencilSurface failed with 0x%08x\n", hr); + ok(surface != NULL, "Depth stencil should not be NULL\n"); if (surface) IDirect3DSurface9_Release(surface);
cleanup: diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 90940f8..253afa8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -7612,8 +7612,25 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE ERR("Cannot change the device window yet\n"); } if (pPresentationParameters->EnableAutoDepthStencil && !This->auto_depth_stencil_buffer) { - WARN("Auto depth stencil enabled, but no auto depth stencil present, returning WINED3DERR_INVALIDCALL\n"); - return WINED3DERR_INVALIDCALL; + HRESULT hrc; + + TRACE("Creating the depth stencil buffer\n"); + + hrc = IWineD3DDeviceParent_CreateDepthStencilSurface(This->device_parent, + This->parent, + pPresentationParameters->BackBufferWidth, + pPresentationParameters->BackBufferHeight, + pPresentationParameters->AutoDepthStencilFormat, + pPresentationParameters->MultiSampleType, + pPresentationParameters->MultiSampleQuality, + FALSE, + &This->auto_depth_stencil_buffer); + + if (FAILED(hrc)) { + ERR("Failed to create the depth stencil buffer\n"); + IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain); + return WINED3DERR_INVALIDCALL; + } }
/* Reset the depth stencil */