Henri Verbeet : wined3d: Pass a wined3d_state structure to is_invalid_op().

Alexandre Julliard julliard at winehq.org
Thu Sep 23 12:43:48 CDT 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Sep 23 11:48:02 2010 +0200

wined3d: Pass a wined3d_state structure to is_invalid_op().

Instead of an entire device.

---

 dlls/wined3d/nvidia_texture_shader.c |    3 ++-
 dlls/wined3d/state.c                 |    3 ++-
 dlls/wined3d/utils.c                 |   12 ++++++++----
 dlls/wined3d/wined3d_private.h       |    4 ++--
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c
index 380986a..cc25c42 100644
--- a/dlls/wined3d/nvidia_texture_shader.c
+++ b/dlls/wined3d/nvidia_texture_shader.c
@@ -144,7 +144,8 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEX
 
     /* If a texture stage references an invalid texture unit the stage just
     * passes through the result from the previous stage */
-    if (is_invalid_op(This, stage, op, arg1, arg2, arg3)) {
+    if (is_invalid_op(&This->stateBlock->state, stage, op, arg1, arg2, arg3))
+    {
         arg1 = WINED3DTA_CURRENT;
         op = WINED3DTOP_SELECTARG1;
     }
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 772f5f5..2d31fb4 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -2109,7 +2109,8 @@ static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *if
 
         /* If a texture stage references an invalid texture unit the stage just
         * passes through the result from the previous stage */
-    if (is_invalid_op(This, Stage, op, arg1, arg2, arg3)) {
+    if (is_invalid_op(&This->stateBlock->state, Stage, op, arg1, arg2, arg3))
+    {
         arg1 = WINED3DTA_CURRENT;
         op = WINED3DTOP_SELECTARG1;
     }
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 9457bf4..01ca1f9 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2366,9 +2366,11 @@ GLenum CompareFunc(DWORD func) {
     }
 }
 
-BOOL is_invalid_op(IWineD3DDeviceImpl *This, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) {
+BOOL is_invalid_op(const struct wined3d_state *state, int stage,
+        WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3)
+{
     if (op == WINED3DTOP_DISABLE) return FALSE;
-    if (This->stateBlock->state.textures[stage]) return FALSE;
+    if (state->textures[stage]) return FALSE;
 
     if ((arg1 & WINED3DTA_SELECTMASK) == WINED3DTA_TEXTURE
             && op != WINED3DTOP_SELECTARG2) return TRUE;
@@ -2785,7 +2787,8 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
         carg2 = (args[cop] & ARG2) ? stateblock->state.texture_states[i][WINED3DTSS_COLORARG2] : ARG_UNUSED;
         carg0 = (args[cop] & ARG0) ? stateblock->state.texture_states[i][WINED3DTSS_COLORARG0] : ARG_UNUSED;
 
-        if(is_invalid_op(device, i, cop, carg1, carg2, carg0)) {
+        if (is_invalid_op(&stateblock->state, i, cop, carg1, carg2, carg0))
+        {
             carg0 = ARG_UNUSED;
             carg2 = ARG_UNUSED;
             carg1 = WINED3DTA_CURRENT;
@@ -2846,7 +2849,8 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
             }
         }
 
-        if(is_invalid_op(device, i, aop, aarg1, aarg2, aarg0)) {
+        if (is_invalid_op(&stateblock->state, i, aop, aarg1, aarg2, aarg0))
+        {
                aarg0 = ARG_UNUSED;
                aarg2 = ARG_UNUSED;
                aarg1 = WINED3DTA_CURRENT;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 337e91f..842923f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2639,8 +2639,8 @@ const char *debug_surflocation(DWORD flag) DECLSPEC_HIDDEN;
 /* Routines for GL <-> D3D values */
 GLenum StencilOp(DWORD op) DECLSPEC_HIDDEN;
 GLenum CompareFunc(DWORD func) DECLSPEC_HIDDEN;
-BOOL is_invalid_op(IWineD3DDeviceImpl *This, int stage, WINED3DTEXTUREOP op,
-        DWORD arg1, DWORD arg2, DWORD arg3) DECLSPEC_HIDDEN;
+BOOL is_invalid_op(const struct wined3d_state *state, int stage,
+        WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) DECLSPEC_HIDDEN;
 void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op,
         DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst) DECLSPEC_HIDDEN;
 void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords,




More information about the wine-cvs mailing list