Commit 478a0aae authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a wined3d_state structure to is_invalid_op().

Instead of an entire device.
parent e7e1ec62
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment