Henri Verbeet : wined3d: wined3d_device_set_texture_stage_state() never fails.

Alexandre Julliard julliard at winehq.org
Wed Sep 26 14:06:49 CDT 2012


Module: wine
Branch: master
Commit: 26c071400900bc80298228ec4c66640fa2475427
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=26c071400900bc80298228ec4c66640fa2475427

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Sep 26 10:12:13 2012 +0200

wined3d: wined3d_device_set_texture_stage_state() never fails.

---

 dlls/d3d8/device.c     |    5 ++---
 dlls/d3d9/device.c     |    5 ++---
 dlls/ddraw/device.c    |    5 ++---
 dlls/wined3d/device.c  |   14 ++++++--------
 include/wine/wined3d.h |    2 +-
 5 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 4a96c2f..5dc3d53 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1812,7 +1812,6 @@ static HRESULT WINAPI d3d8_device_SetTextureStageState(IDirect3DDevice8 *iface,
 {
     struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
     const struct tss_lookup *l;
-    HRESULT hr = D3D_OK;
 
     TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, stage, type, value);
 
@@ -1828,10 +1827,10 @@ static HRESULT WINAPI d3d8_device_SetTextureStageState(IDirect3DDevice8 *iface,
     if (l->sampler_state)
         wined3d_device_set_sampler_state(device->wined3d_device, stage, l->state, value);
     else
-        hr = wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->state, value);
+        wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->state, value);
     wined3d_mutex_unlock();
 
-    return hr;
+    return D3D_OK;
 }
 
 static HRESULT WINAPI d3d8_device_ValidateDevice(IDirect3DDevice8 *iface, DWORD *pass_count)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index d194642..1012d04 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1773,7 +1773,6 @@ static HRESULT WINAPI d3d9_device_SetTextureStageState(IDirect3DDevice9Ex *iface
         DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
 {
     struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
-    HRESULT hr;
 
     TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, stage, state, value);
 
@@ -1784,10 +1783,10 @@ static HRESULT WINAPI d3d9_device_SetTextureStageState(IDirect3DDevice9Ex *iface
     }
 
     wined3d_mutex_lock();
-    hr = wined3d_device_set_texture_stage_state(device->wined3d_device, stage, tss_lookup[state], value);
+    wined3d_device_set_texture_stage_state(device->wined3d_device, stage, tss_lookup[state], value);
     wined3d_mutex_unlock();
 
-    return hr;
+    return D3D_OK;
 }
 
 static HRESULT WINAPI d3d9_device_GetSamplerState(IDirect3DDevice9Ex *iface,
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 86cd5c1..f4b403f 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -4684,7 +4684,6 @@ static HRESULT d3d_device7_SetTextureStageState(IDirect3DDevice7 *iface,
 {
     struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
     const struct tss_lookup *l;
-    HRESULT hr = D3D_OK;
 
     TRACE("iface %p, stage %u, state %#x, value %#x.\n",
             iface, stage, state, value);
@@ -4766,12 +4765,12 @@ static HRESULT d3d_device7_SetTextureStageState(IDirect3DDevice7 *iface,
     }
     else
     {
-        hr = wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->state, value);
+        wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->state, value);
     }
 
     wined3d_mutex_unlock();
 
-    return hr;
+    return D3D_OK;
 }
 
 static HRESULT WINAPI d3d_device7_SetTextureStageState_FPUSetup(IDirect3DDevice7 *iface,
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0d78257..1ae5283 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3343,7 +3343,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
     return hr;
 }
 
-HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device,
+void CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device,
         UINT stage, enum wined3d_texture_stage_state state, DWORD value)
 {
     const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -3355,14 +3355,14 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
     if (state > WINED3D_HIGHEST_TEXTURE_STATE)
     {
         WARN("Invalid state %#x passed.\n", state);
-        return WINED3D_OK;
+        return;
     }
 
     if (stage >= gl_info->limits.texture_stages)
     {
         WARN("Attempting to set stage %u which is higher than the max stage %u, ignoring.\n",
                 stage, gl_info->limits.texture_stages - 1);
-        return WINED3D_OK;
+        return;
     }
 
     old_value = device->updateStateBlock->state.texture_states[stage][state];
@@ -3372,14 +3372,14 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
     if (device->isRecordingState)
     {
         TRACE("Recording... not performing anything.\n");
-        return WINED3D_OK;
+        return;
     }
 
     /* Checked after the assignments to allow proper stateblock recording. */
     if (old_value == value)
     {
         TRACE("Application is setting the old value over, nothing to do.\n");
-        return WINED3D_OK;
+        return;
     }
 
     if (stage > device->stateBlock->state.lowest_disabled_stage
@@ -3389,7 +3389,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
         /* Colorop change above lowest disabled stage? That won't change
          * anything in the GL setup. Changes in other states are important on
          * disabled stages too. */
-        return WINED3D_OK;
+        return;
     }
 
     if (state == WINED3D_TSS_COLOR_OP)
@@ -3433,8 +3433,6 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
     }
 
     device_invalidate_state(device, STATE_TEXTURESTAGE(stage, state));
-
-    return WINED3D_OK;
 }
 
 HRESULT CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 040fbfe..ec099b5 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2230,7 +2230,7 @@ HRESULT __cdecl wined3d_device_set_stream_source(struct wined3d_device *device,
         UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride);
 HRESULT __cdecl wined3d_device_set_stream_source_freq(struct wined3d_device *device, UINT stream_idx, UINT divider);
 HRESULT __cdecl wined3d_device_set_texture(struct wined3d_device *device, UINT stage, struct wined3d_texture *texture);
-HRESULT __cdecl wined3d_device_set_texture_stage_state(struct wined3d_device *device,
+void __cdecl wined3d_device_set_texture_stage_state(struct wined3d_device *device,
         UINT stage, enum wined3d_texture_stage_state state, DWORD value);
 void __cdecl wined3d_device_set_transform(struct wined3d_device *device,
         enum wined3d_transform_state state, const struct wined3d_matrix *matrix);




More information about the wine-cvs mailing list