From 75cec973d5ba6aa7d65b8dabb76617457af1d94b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 11 Sep 2012 00:27:02 +0200 Subject: [PATCH] wined3d: wined3d_device_set_render_state() never fails. --- dlls/d3d8/device.c | 16 +++++----------- dlls/d3d9/device.c | 5 ++--- dlls/ddraw/device.c | 6 ++++-- dlls/wined3d/device.c | 6 ++---- include/wine/wined3d.h | 2 +- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 5a029f20cb6..2cf957e73fb 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -600,7 +600,7 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface, wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters); if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc, NULL, reset_enum_callback))) { - hr = wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0); device->lost = FALSE; } else @@ -1453,7 +1453,6 @@ static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface, D3DRENDERSTATETYPE state, DWORD value) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); - HRESULT hr; TRACE("iface %p, state %#x, value %#x.\n", iface, state, value); @@ -1461,15 +1460,15 @@ static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface, switch (state) { case D3DRS_ZBIAS: - hr = wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, value); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, value); break; default: - hr = wined3d_device_set_render_state(device->wined3d_device, state, value); + wined3d_device_set_render_state(device->wined3d_device, state, value); } wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI d3d8_device_GetRenderState(IDirect3DDevice8 *iface, @@ -3038,13 +3037,8 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine return hr; } - hr = wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0); wined3d_mutex_unlock(); - if (FAILED(hr)) - { - ERR("Failed to set minimum pointsize, hr %#x.\n", hr); - goto err; - } present_parameters_from_wined3d_swapchain_desc(parameters, &swapchain_desc); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 2e33c9fda66..63a611ddb8c 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1519,15 +1519,14 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevi D3DRENDERSTATETYPE state, DWORD value) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; TRACE("iface %p, state %#x, value %#x.\n", iface, state, value); wined3d_mutex_lock(); - hr = wined3d_device_set_render_state(device->wined3d_device, state, value); + wined3d_device_set_render_state(device->wined3d_device, state, value); wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface, diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 7848b0d78f0..a81fa310f1c 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -2627,7 +2627,8 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface, break; case D3DRENDERSTATE_ZBIAS: - hr = wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, value); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, value); + hr = D3D_OK; break; default: @@ -2639,7 +2640,8 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface, break; } - hr = wined3d_device_set_render_state(device->wined3d_device, state, value); + wined3d_device_set_render_state(device->wined3d_device, state, value); + hr = D3D_OK; break; } wined3d_mutex_unlock(); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e0849cef29b..3998408db77 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2317,7 +2317,7 @@ void CDECL wined3d_device_get_viewport(const struct wined3d_device *device, stru *viewport = device->stateBlock->state.viewport; } -HRESULT CDECL wined3d_device_set_render_state(struct wined3d_device *device, +void CDECL wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, DWORD value) { DWORD old_value = device->stateBlock->state.render_states[state]; @@ -2331,7 +2331,7 @@ HRESULT CDECL wined3d_device_set_render_state(struct wined3d_device *device, if (device->isRecordingState) { TRACE("Recording... not performing anything.\n"); - return WINED3D_OK; + return; } /* Compared here and not before the assignment to allow proper stateblock recording. */ @@ -2339,8 +2339,6 @@ HRESULT CDECL wined3d_device_set_render_state(struct wined3d_device *device, TRACE("Application is setting the old value over, nothing to do.\n"); else device_invalidate_state(device, STATE_RENDER(state)); - - return WINED3D_OK; } HRESULT CDECL wined3d_device_get_render_state(const struct wined3d_device *device, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 1fa13420050..d2a2811da72 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2220,7 +2220,7 @@ HRESULT __cdecl wined3d_device_set_ps_consts_f(struct wined3d_device *device, UINT start_register, const float *constants, UINT vector4f_count); HRESULT __cdecl wined3d_device_set_ps_consts_i(struct wined3d_device *device, UINT start_register, const int *constants, UINT vector4i_count); -HRESULT __cdecl wined3d_device_set_render_state(struct wined3d_device *device, +void __cdecl wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, DWORD value); HRESULT __cdecl wined3d_device_set_render_target(struct wined3d_device *device, UINT render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport);