From 463162b4143ee03193aade846acb7202ba3f7f5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20D=C3=B6singer?= Date: Mon, 25 Apr 2011 16:51:27 +0200 Subject: [PATCH] d3d8: Don't reapply the old DS if SetDepthStencilSurface failed. --- dlls/d3d8/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 47a727d583f..ae90a1612ec 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1047,8 +1047,10 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(IDirect3DDevice8 *ifa { hr = IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, pZSurface ? pZSurface->wineD3DSurface : NULL); if (SUCCEEDED(hr) && pSurface) + { hr = IWineD3DDevice_SetRenderTarget(This->WineD3DDevice, 0, pSurface->wineD3DSurface, TRUE); - if (FAILED(hr)) IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, original_ds); + if (FAILED(hr)) IWineD3DDevice_SetDepthStencilSurface(This->WineD3DDevice, original_ds); + } } if (original_ds) IWineD3DSurface_Release(original_ds); -- 2.11.4.GIT