diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 2cf957e73fb..25f753450ef 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -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) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 63a611ddb8c..e10b6985033 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -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, diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index a81fa310f1c..f51222be84d 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -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(); diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 29feb8778a0..39a977fc367 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -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); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3998408db77..2cf302801ba 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index c211e4a2870..7aea7145857 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -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) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d2a2811da72..d581097b644 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -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,