diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 751ba0557e5..4f6162c9c28 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 af2a92fcae3..4d5c76259cc 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 fa35105e81c..f9ff67c354d 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 d527949a462..bc3e17f600e 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);