wined3d: Pass a wined3d_state structure to set_tex_op_nvrc().
authorHenri Verbeet <hverbeet@codeweavers.com>
Thu, 23 Sep 2010 09:48:03 +0000 (11:48 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 23 Sep 2010 10:06:31 +0000 (12:06 +0200)
dlls/wined3d/nvidia_texture_shader.c
dlls/wined3d/state.c
dlls/wined3d/wined3d_private.h

index cc25c428f6e11d1059a08dedf2e6eaa913c2b61b..6576e615c6ce81a6036a9ebd05724f7bbce0fe08 100644 (file)
@@ -131,9 +131,9 @@ static void get_src_and_opr_nvrc(DWORD stage, DWORD arg, BOOL is_alpha, GLenum*
     *input = d3dta_to_combiner_input(arg & WINED3DTA_SELECTMASK, stage, texture_idx);
 }
 
-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) {
-    IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl*)iface;
-    const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
+void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, BOOL is_alpha,
+        int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst)
+{
     tex_op_args tex_op_args = {{0}, {0}, {0}};
     GLenum portion = is_alpha ? GL_ALPHA : GL_RGB;
     GLenum target = GL_COMBINER0_NV + stage;
@@ -144,7 +144,7 @@ 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->stateBlock->state, stage, op, arg1, arg2, arg3))
+    if (is_invalid_op(state, stage, op, arg1, arg2, arg3))
     {
         arg1 = WINED3DTA_CURRENT;
         op = WINED3DTOP_SELECTARG1;
@@ -538,7 +538,7 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
     }
 
     /* Set the texture combiners */
-    set_tex_op_nvrc((IWineD3DDevice *)stateblock->device, FALSE, stage,
+    set_tex_op_nvrc(gl_info, &stateblock->state, FALSE, stage,
             stateblock->state.texture_states[stage][WINED3DTSS_COLOROP],
             stateblock->state.texture_states[stage][WINED3DTSS_COLORARG1],
             stateblock->state.texture_states[stage][WINED3DTSS_COLORARG2],
index 2d31fb4d091ef7fd9d32aa541bb53f0eca193641..d8240053f8ebcf974abe4a583f6b425a7764b537 100644 (file)
@@ -3254,7 +3254,7 @@ void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d
     TRACE("Setting alpha op for stage %d\n", stage);
     if (gl_info->supported[NV_REGISTER_COMBINERS])
     {
-        set_tex_op_nvrc((IWineD3DDevice *)stateblock->device, TRUE, stage, op, arg1, arg2, arg0,
+        set_tex_op_nvrc(gl_info, &stateblock->state, TRUE, stage, op, arg1, arg2, arg0,
                 mapped_stage, stateblock->state.texture_states[stage][WINED3DTSS_RESULTARG]);
     }
     else
index 842923fdf6a13eb8d0007722328a4d2ed8893671..66854127b222080247713f5c3d4d39b9f4799995 100644 (file)
@@ -2641,8 +2641,9 @@ GLenum StencilOp(DWORD op) DECLSPEC_HIDDEN;
 GLenum CompareFunc(DWORD func) 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_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state,
+        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,
         BOOL transformed, enum wined3d_format_id coordtype, BOOL ffp_can_disable_proj) DECLSPEC_HIDDEN;
 void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock,