[PATCH 2/4] wined3d: Pass a wined3d_state structure to set_tex_op_nvrc().
Henri Verbeet
hverbeet at codeweavers.com
Thu Sep 23 04:48:03 CDT 2010
---
dlls/wined3d/nvidia_texture_shader.c | 10 +++++-----
dlls/wined3d/state.c | 2 +-
dlls/wined3d/wined3d_private.h | 5 +++--
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c
index cc25c42..6576e61 100644
--- a/dlls/wined3d/nvidia_texture_shader.c
+++ b/dlls/wined3d/nvidia_texture_shader.c
@@ -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],
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 2d31fb4..d824005 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -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
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 842923f..6685412 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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,
--
1.7.2.2
More information about the wine-patches
mailing list