wined3d: SetDepthStencilSurface is always called when AutoDepthStencil is enabled.

This commit is contained in:
David Adam 2009-04-23 08:33:21 +02:00 committed by Alexandre Julliard
parent 3ab52c2097
commit 33eb939390
3 changed files with 25 additions and 8 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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 */