Henri Verbeet : wined3d: wined3d_stateblock_apply() never fails.
Alexandre Julliard
julliard at winehq.org
Mon Oct 8 13:39:55 CDT 2012
Module: wine
Branch: master
Commit: 8e24dbb60a95b731013044d6e084272b642e9e0e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e24dbb60a95b731013044d6e084272b642e9e0e
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Oct 4 23:42:17 2012 +0200
wined3d: wined3d_stateblock_apply() never fails.
---
dlls/d3d8/device.c | 5 ++---
dlls/d3d9/stateblock.c | 5 ++---
dlls/ddraw/ddraw.c | 8 +-------
dlls/ddraw/device.c | 5 ++---
dlls/wined3d/stateblock.c | 4 +---
include/wine/wined3d.h | 2 +-
6 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index a8af52e..a7d5267 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1532,7 +1532,6 @@ static HRESULT WINAPI d3d8_device_ApplyStateBlock(IDirect3DDevice8 *iface, DWORD
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
struct wined3d_stateblock *stateblock;
- HRESULT hr;
TRACE("iface %p, token %#x.\n", iface, token);
@@ -1547,10 +1546,10 @@ static HRESULT WINAPI d3d8_device_ApplyStateBlock(IDirect3DDevice8 *iface, DWORD
wined3d_mutex_unlock();
return D3DERR_INVALIDCALL;
}
- hr = wined3d_stateblock_apply(stateblock);
+ wined3d_stateblock_apply(stateblock);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWORD token)
diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c
index 4af2247..5eea835 100644
--- a/dlls/d3d9/stateblock.c
+++ b/dlls/d3d9/stateblock.c
@@ -108,15 +108,14 @@ static HRESULT WINAPI d3d9_stateblock_Capture(IDirect3DStateBlock9 *iface)
static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface)
{
struct d3d9_stateblock *stateblock = impl_from_IDirect3DStateBlock9(iface);
- HRESULT hr;
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
- hr = wined3d_stateblock_apply(stateblock->wined3d_stateblock);
+ wined3d_stateblock_apply(stateblock->wined3d_stateblock);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index c2a7be1..f34888d 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -955,14 +955,8 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
wined3d_surface_decref(rt);
}
- hr = wined3d_stateblock_apply(stateblock);
+ wined3d_stateblock_apply(stateblock);
wined3d_stateblock_decref(stateblock);
- if (FAILED(hr))
- {
- ERR("Failed to apply stateblock, hr %#x.\n", hr);
- wined3d_mutex_unlock();
- return hr;
- }
}
/* Unhandled flags */
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index a0b6781..ba7d011 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -5380,7 +5380,6 @@ static HRESULT d3d_device7_ApplyStateBlock(IDirect3DDevice7 *iface, DWORD stateb
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
struct wined3d_stateblock *wined3d_sb;
- HRESULT hr;
TRACE("iface %p, stateblock %#x.\n", iface, stateblock);
@@ -5393,10 +5392,10 @@ static HRESULT d3d_device7_ApplyStateBlock(IDirect3DDevice7 *iface, DWORD stateb
return D3DERR_INVALIDSTATEBLOCK;
}
- hr = wined3d_stateblock_apply(wined3d_sb);
+ wined3d_stateblock_apply(wined3d_sb);
wined3d_mutex_unlock();
- return hr_ddraw_from_wined3d(hr);
+ return D3D_OK;
}
static HRESULT WINAPI d3d_device7_ApplyStateBlock_FPUSetup(IDirect3DDevice7 *iface, DWORD stateblock)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index a2524f1..c399bad 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -917,7 +917,7 @@ static void apply_lights(struct wined3d_device *device, const struct wined3d_sta
}
}
-HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
+void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
{
struct wined3d_device *device = stateblock->device;
unsigned int i;
@@ -1072,8 +1072,6 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
}
TRACE("Applied stateblock %p.\n", stateblock);
-
- return WINED3D_OK;
}
void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index bb44969..42b21e6 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2304,7 +2304,7 @@ ULONG __cdecl wined3d_shader_incref(struct wined3d_shader *shader);
HRESULT __cdecl wined3d_shader_set_local_constants_float(struct wined3d_shader *shader,
UINT start_idx, const float *src_data, UINT vector4f_count);
-HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock);
+void __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock);
void __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock);
HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device,
enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock);
More information about the wine-cvs
mailing list