Commit d601a0de authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: wined3d_device_get_render_state() never fails.

parent 75cec973
......@@ -1475,7 +1475,6 @@ static HRESULT WINAPI d3d8_device_GetRenderState(IDirect3DDevice8 *iface,
D3DRENDERSTATETYPE state, DWORD *value)
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
HRESULT hr;
TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
......@@ -1483,15 +1482,15 @@ static HRESULT WINAPI d3d8_device_GetRenderState(IDirect3DDevice8 *iface,
switch (state)
{
case D3DRS_ZBIAS:
hr = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, value);
*value = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS);
break;
default:
hr = wined3d_device_get_render_state(device->wined3d_device, state, value);
*value = wined3d_device_get_render_state(device->wined3d_device, state);
}
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d8_device_BeginStateBlock(IDirect3DDevice8 *iface)
......
......@@ -1533,15 +1533,14 @@ static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface,
D3DRENDERSTATETYPE state, DWORD *value)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
HRESULT hr;
TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
wined3d_mutex_lock();
hr = wined3d_device_get_render_state(device->wined3d_device, state, value);
*value = wined3d_device_get_render_state(device->wined3d_device, state);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d9_device_CreateStateBlock(IDirect3DDevice9Ex *iface,
......
......@@ -2331,7 +2331,8 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface,
break;
case D3DRENDERSTATE_ZBIAS:
hr = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, value);
*value = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS);
hr = D3D_OK;
break;
default:
......@@ -2342,7 +2343,8 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface,
hr = E_NOTIMPL;
break;
}
hr = wined3d_device_get_render_state(device->wined3d_device, state, value);
*value = wined3d_device_get_render_state(device->wined3d_device, state);
hr = D3D_OK;
}
wined3d_mutex_unlock();
......
......@@ -339,7 +339,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_ProcessVertices(IDirect3DVertexBuffer7
* the vertex ops
*/
doClip = !!(vertex_op & D3DVOP_CLIP);
wined3d_device_get_render_state(device_impl->wined3d_device, WINED3D_RS_CLIPPING, (DWORD *)&oldClip);
oldClip = wined3d_device_get_render_state(device_impl->wined3d_device, WINED3D_RS_CLIPPING);
if (doClip != oldClip)
wined3d_device_set_render_state(device_impl->wined3d_device, WINED3D_RS_CLIPPING, doClip);
......
......@@ -2341,14 +2341,11 @@ void CDECL wined3d_device_set_render_state(struct wined3d_device *device,
device_invalidate_state(device, STATE_RENDER(state));
}
HRESULT CDECL wined3d_device_get_render_state(const struct wined3d_device *device,
enum wined3d_render_state state, DWORD *value)
DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state)
{
TRACE("device %p, state %s (%#x), value %p.\n", device, debug_d3drenderstate(state), state, value);
TRACE("device %p, state %s (%#x).\n", device, debug_d3drenderstate(state), state);
*value = device->stateBlock->state.render_states[state];
return WINED3D_OK;
return device->stateBlock->state.render_states[state];
}
HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
......
......@@ -75,7 +75,7 @@
@ cdecl wined3d_device_get_ps_consts_f(ptr long ptr long)
@ cdecl wined3d_device_get_ps_consts_i(ptr long ptr long)
@ cdecl wined3d_device_get_raster_status(ptr long ptr)
@ cdecl wined3d_device_get_render_state(ptr long ptr)
@ cdecl wined3d_device_get_render_state(ptr long)
@ cdecl wined3d_device_get_render_target(ptr long ptr)
@ cdecl wined3d_device_get_sampler_state(ptr long long ptr)
@ cdecl wined3d_device_get_scissor_rect(ptr ptr)
......
......@@ -2142,8 +2142,7 @@ HRESULT __cdecl wined3d_device_get_ps_consts_i(const struct wined3d_device *devi
UINT start_register, int *constants, UINT vector4i_count);
HRESULT __cdecl wined3d_device_get_raster_status(const struct wined3d_device *device,
UINT swapchain_idx, struct wined3d_raster_status *raster_status);
HRESULT __cdecl wined3d_device_get_render_state(const struct wined3d_device *device,
enum wined3d_render_state state, DWORD *value);
DWORD __cdecl wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state);
HRESULT __cdecl wined3d_device_get_render_target(const struct wined3d_device *device,
UINT render_target_idx, struct wined3d_surface **render_target);
HRESULT __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *device,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment