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

wined3d: wined3d_stateblock_capture() never fails.

parent b2228834
...@@ -1557,7 +1557,6 @@ static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWO ...@@ -1557,7 +1557,6 @@ static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWO
{ {
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
struct wined3d_stateblock *stateblock; struct wined3d_stateblock *stateblock;
HRESULT hr;
TRACE("iface %p, token %#x.\n", iface, token); TRACE("iface %p, token %#x.\n", iface, token);
...@@ -1569,10 +1568,10 @@ static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWO ...@@ -1569,10 +1568,10 @@ static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWO
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
} }
hr = wined3d_stateblock_capture(stateblock); wined3d_stateblock_capture(stateblock);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return D3D_OK;
} }
static HRESULT WINAPI d3d8_device_DeleteStateBlock(IDirect3DDevice8 *iface, DWORD token) static HRESULT WINAPI d3d8_device_DeleteStateBlock(IDirect3DDevice8 *iface, DWORD token)
......
...@@ -95,15 +95,14 @@ static HRESULT WINAPI d3d9_stateblock_GetDevice(IDirect3DStateBlock9 *iface, IDi ...@@ -95,15 +95,14 @@ static HRESULT WINAPI d3d9_stateblock_GetDevice(IDirect3DStateBlock9 *iface, IDi
static HRESULT WINAPI d3d9_stateblock_Capture(IDirect3DStateBlock9 *iface) static HRESULT WINAPI d3d9_stateblock_Capture(IDirect3DStateBlock9 *iface)
{ {
struct d3d9_stateblock *stateblock = impl_from_IDirect3DStateBlock9(iface); struct d3d9_stateblock *stateblock = impl_from_IDirect3DStateBlock9(iface);
HRESULT hr;
TRACE("iface %p.\n", iface); TRACE("iface %p.\n", iface);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_stateblock_capture(stateblock->wined3d_stateblock); wined3d_stateblock_capture(stateblock->wined3d_stateblock);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return D3D_OK;
} }
static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface)
......
...@@ -924,14 +924,7 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd, ...@@ -924,14 +924,7 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
return hr; return hr;
} }
if (FAILED(hr = wined3d_stateblock_capture(stateblock))) wined3d_stateblock_capture(stateblock);
{
ERR("Failed to capture stateblock, hr %#x.\n", hr);
wined3d_stateblock_decref(stateblock);
wined3d_mutex_unlock();
return hr;
}
rt = wined3d_device_get_render_target(This->wined3d_device, 0); rt = wined3d_device_get_render_target(This->wined3d_device, 0);
if (rt == This->wined3d_frontbuffer) if (rt == This->wined3d_frontbuffer)
rt = NULL; rt = NULL;
......
...@@ -5436,7 +5436,6 @@ static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stat ...@@ -5436,7 +5436,6 @@ static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stat
{ {
struct d3d_device *device = impl_from_IDirect3DDevice7(iface); struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
struct wined3d_stateblock *wined3d_sb; struct wined3d_stateblock *wined3d_sb;
HRESULT hr;
TRACE("iface %p, stateblock %#x.\n", iface, stateblock); TRACE("iface %p, stateblock %#x.\n", iface, stateblock);
...@@ -5449,10 +5448,10 @@ static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stat ...@@ -5449,10 +5448,10 @@ static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stat
return D3DERR_INVALIDSTATEBLOCK; return D3DERR_INVALIDSTATEBLOCK;
} }
hr = wined3d_stateblock_capture(wined3d_sb); wined3d_stateblock_capture(wined3d_sb);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr_ddraw_from_wined3d(hr); return D3D_OK;
} }
static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUSetup(IDirect3DDevice7 *iface, DWORD stateblock) static HRESULT WINAPI d3d_device7_CaptureStateBlock_FPUSetup(IDirect3DDevice7 *iface, DWORD stateblock)
......
...@@ -611,7 +611,7 @@ static void wined3d_state_record_lights(struct wined3d_state *dst_state, const s ...@@ -611,7 +611,7 @@ static void wined3d_state_record_lights(struct wined3d_state *dst_state, const s
} }
} }
HRESULT CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
{ {
const struct wined3d_state *src_state = &stateblock->device->stateBlock->state; const struct wined3d_state *src_state = &stateblock->device->stateBlock->state;
unsigned int i; unsigned int i;
...@@ -897,8 +897,6 @@ HRESULT CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) ...@@ -897,8 +897,6 @@ HRESULT CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
wined3d_state_record_lights(&stateblock->state, src_state); wined3d_state_record_lights(&stateblock->state, src_state);
TRACE("Capture done.\n"); TRACE("Capture done.\n");
return WINED3D_OK;
} }
static void apply_lights(struct wined3d_device *device, const struct wined3d_state *state) static void apply_lights(struct wined3d_device *device, const struct wined3d_state *state)
......
...@@ -2305,7 +2305,7 @@ HRESULT __cdecl wined3d_shader_set_local_constants_float(struct wined3d_shader * ...@@ -2305,7 +2305,7 @@ HRESULT __cdecl wined3d_shader_set_local_constants_float(struct wined3d_shader *
UINT start_idx, const float *src_data, UINT vector4f_count); UINT start_idx, const float *src_data, UINT vector4f_count);
HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock); HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock);
HRESULT __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock); void __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock);
HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device, HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device,
enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock); enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock);
ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
......
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