Module: wine Branch: master Commit: 6e5cf8c69885733c78135983cfaf39d791760160 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6e5cf8c69885733c78135983cf...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Oct 1 22:48:11 2012 +0200
wined3d: wined3d_device_set_depth_stencil() never fails.
---
dlls/d3d8/device.c | 6 +++--- dlls/d3d9/device.c | 5 ++--- dlls/wined3d/device.c | 6 +++--- include/wine/wined3d.h | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 751ba05..4f6162c 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1085,7 +1085,7 @@ static HRESULT WINAPI d3d8_device_SetRenderTarget(IDirect3DDevice8 *iface, struct d3d8_surface *rt_impl = unsafe_impl_from_IDirect3DSurface8(render_target); struct d3d8_surface *ds_impl = unsafe_impl_from_IDirect3DSurface8(depth_stencil); struct wined3d_surface *original_ds = NULL; - HRESULT hr; + HRESULT hr = D3D_OK;
TRACE("iface %p, render_target %p, depth_stencil %p.\n", iface, render_target, depth_stencil);
@@ -1123,8 +1123,8 @@ static HRESULT WINAPI d3d8_device_SetRenderTarget(IDirect3DDevice8 *iface, }
original_ds = wined3d_device_get_depth_stencil(device->wined3d_device); - hr = wined3d_device_set_depth_stencil(device->wined3d_device, ds_impl ? ds_impl->wined3d_surface : NULL); - if (SUCCEEDED(hr) && render_target) + wined3d_device_set_depth_stencil(device->wined3d_device, ds_impl ? ds_impl->wined3d_surface : NULL); + if (render_target) { hr = wined3d_device_set_render_target(device->wined3d_device, 0, rt_impl->wined3d_surface, TRUE); if (FAILED(hr)) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index af2a92f..4d5c762 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1224,15 +1224,14 @@ static HRESULT WINAPI d3d9_device_SetDepthStencilSurface(IDirect3DDevice9Ex *ifa { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_surface *ds_impl = unsafe_impl_from_IDirect3DSurface9(depth_stencil); - HRESULT hr;
TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
wined3d_mutex_lock(); - hr = wined3d_device_set_depth_stencil(device->wined3d_device, ds_impl ? ds_impl->wined3d_surface : NULL); + wined3d_device_set_depth_stencil(device->wined3d_device, ds_impl ? ds_impl->wined3d_surface : NULL); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static HRESULT WINAPI d3d9_device_GetDepthStencilSurface(IDirect3DDevice9Ex *iface, IDirect3DSurface9 **depth_stencil) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index fa35105..f9ff67c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4568,7 +4568,7 @@ HRESULT CDECL wined3d_device_set_render_target(struct wined3d_device *device, return WINED3D_OK; }
-HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil) +void CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil) { struct wined3d_surface *prev = device->fb.depth_stencil;
@@ -4578,7 +4578,7 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st if (prev == depth_stencil) { TRACE("Trying to do a NOP SetRenderTarget operation.\n"); - return WINED3D_OK; + return; }
if (prev) @@ -4617,7 +4617,7 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
device_invalidate_state(device, STATE_FRAMEBUFFER);
- return WINED3D_OK; + return; }
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d527949..bc3e17f 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2195,7 +2195,7 @@ void __cdecl wined3d_device_set_cursor_position(struct wined3d_device *device, int x_screen_space, int y_screen_space, DWORD flags); HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *device, UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_surface); -HRESULT __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil); +void __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil); HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs); void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, DWORD flags, const struct wined3d_gamma_ramp *ramp);