wined3d: wined3d_device_set_render_state() never fails.

This commit is contained in:
Henri Verbeet 2012-09-11 00:27:02 +02:00 committed by Alexandre Julliard
parent d2fdeaa4fe
commit 75cec973d5
5 changed files with 14 additions and 21 deletions

View File

@ -600,7 +600,7 @@ static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface,
wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters); 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))) 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; device->lost = FALSE;
} }
else else
@ -1453,7 +1453,6 @@ static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface,
D3DRENDERSTATETYPE state, DWORD value) D3DRENDERSTATETYPE state, DWORD value)
{ {
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
HRESULT hr;
TRACE("iface %p, state %#x, value %#x.\n", iface, state, value); 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) switch (state)
{ {
case D3DRS_ZBIAS: 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; break;
default: 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(); wined3d_mutex_unlock();
return hr; return D3D_OK;
} }
static HRESULT WINAPI d3d8_device_GetRenderState(IDirect3DDevice8 *iface, 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; 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(); 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); present_parameters_from_wined3d_swapchain_desc(parameters, &swapchain_desc);

View File

@ -1519,15 +1519,14 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevi
D3DRENDERSTATETYPE state, DWORD value) D3DRENDERSTATETYPE state, DWORD value)
{ {
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
HRESULT hr;
TRACE("iface %p, state %#x, value %#x.\n", iface, state, value); TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
wined3d_mutex_lock(); 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(); wined3d_mutex_unlock();
return hr; return D3D_OK;
} }
static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface, static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface,

View File

@ -2627,7 +2627,8 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
break; break;
case D3DRENDERSTATE_ZBIAS: 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; break;
default: default:
@ -2639,7 +2640,8 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
break; 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; break;
} }
wined3d_mutex_unlock(); wined3d_mutex_unlock();

View File

@ -2317,7 +2317,7 @@ void CDECL wined3d_device_get_viewport(const struct wined3d_device *device, stru
*viewport = device->stateBlock->state.viewport; *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) enum wined3d_render_state state, DWORD value)
{ {
DWORD old_value = device->stateBlock->state.render_states[state]; 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) if (device->isRecordingState)
{ {
TRACE("Recording... not performing anything.\n"); TRACE("Recording... not performing anything.\n");
return WINED3D_OK; return;
} }
/* Compared here and not before the assignment to allow proper stateblock recording. */ /* 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"); TRACE("Application is setting the old value over, nothing to do.\n");
else else
device_invalidate_state(device, STATE_RENDER(state)); device_invalidate_state(device, STATE_RENDER(state));
return WINED3D_OK;
} }
HRESULT CDECL wined3d_device_get_render_state(const struct wined3d_device *device, HRESULT CDECL wined3d_device_get_render_state(const struct wined3d_device *device,

View File

@ -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); UINT start_register, const float *constants, UINT vector4f_count);
HRESULT __cdecl wined3d_device_set_ps_consts_i(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_ps_consts_i(struct wined3d_device *device,
UINT start_register, const int *constants, UINT vector4i_count); 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); enum wined3d_render_state state, DWORD value);
HRESULT __cdecl wined3d_device_set_render_target(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_render_target(struct wined3d_device *device,
UINT render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport); UINT render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport);