Commit b6431d94 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the WINED3DTEXTUREOP typedef.

parent bd3b0ba6
......@@ -2550,21 +2550,18 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
wined3d_device_get_texture_stage_state(This->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG1, &alphaarg1);
wined3d_device_get_texture_stage_state(This->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG2, &alphaarg2);
if (colorop == WINED3DTOP_SELECTARG1 && colorarg1 == WINED3DTA_TEXTURE &&
alphaop == WINED3DTOP_SELECTARG1 && alphaarg1 == WINED3DTA_TEXTURE)
{
if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE
&& alphaop == WINED3D_TOP_SELECT_ARG1 && alphaarg1 == WINED3DTA_TEXTURE)
*lpdwRenderState = D3DTBLEND_DECAL;
}
else if (colorop == WINED3DTOP_SELECTARG1 && colorarg1 == WINED3DTA_TEXTURE &&
alphaop == WINED3DTOP_MODULATE && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
{
else if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE
&& alphaop == WINED3D_TOP_MODULATE
&& alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
*lpdwRenderState = D3DTBLEND_DECALALPHA;
}
else if (colorop == WINED3DTOP_MODULATE && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT &&
alphaop == WINED3DTOP_MODULATE && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
{
else if (colorop == WINED3D_TOP_MODULATE
&& colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT
&& alphaop == WINED3D_TOP_MODULATE
&& alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT)
*lpdwRenderState = D3DTBLEND_MODULATEALPHA;
}
else
{
struct wined3d_texture *tex = NULL;
......@@ -2591,12 +2588,11 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
wined3d_texture_decref(tex);
}
if (!(colorop == WINED3DTOP_MODULATE && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT &&
alphaop == (tex_alpha ? WINED3DTOP_SELECTARG1 : WINED3DTOP_SELECTARG2) &&
alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT))
{
ERR("Unexpected texture stage state setup, returning D3DTBLEND_MODULATE - likely erroneous\n");
}
if (!(colorop == WINED3D_TOP_MODULATE
&& colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT
&& alphaop == (tex_alpha ? WINED3D_TOP_SELECT_ARG1 : WINED3D_TOP_SELECT_ARG2)
&& alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT))
ERR("Unexpected texture stage state setup, returning D3DTBLEND_MODULATE - likely erroneous.\n");
*lpdwRenderState = D3DTBLEND_MODULATE;
}
......@@ -2897,10 +2893,10 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
if (tex_alpha)
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_SELECTARG1);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG1);
else
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_SELECTARG2);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG2);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_ARG1, WINED3DTA_TEXTURE);
wined3d_device_set_texture_stage_state(This->wined3d_device,
......@@ -2910,19 +2906,19 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_ARG2, WINED3DTA_CURRENT);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_OP, WINED3DTOP_MODULATE);
0, WINED3D_TSS_COLOR_OP, WINED3D_TOP_MODULATE);
break;
}
case D3DTBLEND_ADD:
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_OP, WINED3DTOP_ADD);
0, WINED3D_TSS_COLOR_OP, WINED3D_TOP_ADD);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_ARG1, WINED3DTA_TEXTURE);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_ARG2, WINED3DTA_CURRENT);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_SELECTARG2);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG2);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_ARG2, WINED3DTA_CURRENT);
break;
......@@ -2937,9 +2933,9 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_ARG2, WINED3DTA_CURRENT);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_OP, WINED3DTOP_MODULATE);
0, WINED3D_TSS_COLOR_OP, WINED3D_TOP_MODULATE);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_MODULATE);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_MODULATE);
break;
case D3DTBLEND_COPY:
......@@ -2949,20 +2945,20 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_ARG1, WINED3DTA_TEXTURE);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_OP, WINED3DTOP_SELECTARG1);
0, WINED3D_TSS_COLOR_OP, WINED3D_TOP_SELECT_ARG1);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_SELECTARG1);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG1);
break;
case D3DTBLEND_DECALALPHA:
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_OP, WINED3DTOP_BLENDTEXTUREALPHA);
0, WINED3D_TSS_COLOR_OP, WINED3D_TOP_BLEND_TEXTURE_ALPHA);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_ARG1, WINED3DTA_TEXTURE);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_COLOR_ARG2, WINED3DTA_CURRENT);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_SELECTARG2);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG2);
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_ARG2, WINED3DTA_CURRENT);
break;
......@@ -4766,10 +4762,10 @@ IDirect3DDeviceImpl_3_SetTexture(IDirect3DDevice3 *iface,
/* Arg 1/2 are already set to WINED3DTA_TEXTURE/WINED3DTA_CURRENT in case of D3DTBLEND_MODULATE */
if (tex_alpha)
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_SELECTARG1);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG1);
else
wined3d_device_set_texture_stage_state(This->wined3d_device,
0, WINED3D_TSS_ALPHA_OP, WINED3DTOP_SELECTARG2);
0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG2);
}
wined3d_mutex_unlock();
......
......@@ -2812,8 +2812,8 @@ static void device_update_fixed_function_usage_map(struct wined3d_device *device
for (i = 0; i < MAX_TEXTURES; ++i)
{
const struct wined3d_state *state = &device->stateBlock->state;
WINED3DTEXTUREOP color_op = state->texture_states[i][WINED3D_TSS_COLOR_OP];
WINED3DTEXTUREOP alpha_op = state->texture_states[i][WINED3D_TSS_ALPHA_OP];
enum wined3d_texture_op color_op = state->texture_states[i][WINED3D_TSS_COLOR_OP];
enum wined3d_texture_op alpha_op = state->texture_states[i][WINED3D_TSS_ALPHA_OP];
DWORD color_arg1 = state->texture_states[i][WINED3D_TSS_COLOR_ARG1] & WINED3DTA_SELECTMASK;
DWORD color_arg2 = state->texture_states[i][WINED3D_TSS_COLOR_ARG2] & WINED3DTA_SELECTMASK;
DWORD color_arg3 = state->texture_states[i][WINED3D_TSS_COLOR_ARG0] & WINED3DTA_SELECTMASK;
......@@ -2821,22 +2821,22 @@ static void device_update_fixed_function_usage_map(struct wined3d_device *device
DWORD alpha_arg2 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] & WINED3DTA_SELECTMASK;
DWORD alpha_arg3 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG0] & WINED3DTA_SELECTMASK;
if (color_op == WINED3DTOP_DISABLE) {
/* Not used, and disable higher stages */
/* Not used, and disable higher stages. */
if (color_op == WINED3D_TOP_DISABLE)
break;
}
if (((color_arg1 == WINED3DTA_TEXTURE) && color_op != WINED3DTOP_SELECTARG2)
|| ((color_arg2 == WINED3DTA_TEXTURE) && color_op != WINED3DTOP_SELECTARG1)
if (((color_arg1 == WINED3DTA_TEXTURE) && color_op != WINED3D_TOP_SELECT_ARG2)
|| ((color_arg2 == WINED3DTA_TEXTURE) && color_op != WINED3D_TOP_SELECT_ARG1)
|| ((color_arg3 == WINED3DTA_TEXTURE)
&& (color_op == WINED3DTOP_MULTIPLYADD || color_op == WINED3DTOP_LERP))
|| ((alpha_arg1 == WINED3DTA_TEXTURE) && alpha_op != WINED3DTOP_SELECTARG2)
|| ((alpha_arg2 == WINED3DTA_TEXTURE) && alpha_op != WINED3DTOP_SELECTARG1)
&& (color_op == WINED3D_TOP_MULTIPLY_ADD || color_op == WINED3D_TOP_LERP))
|| ((alpha_arg1 == WINED3DTA_TEXTURE) && alpha_op != WINED3D_TOP_SELECT_ARG2)
|| ((alpha_arg2 == WINED3DTA_TEXTURE) && alpha_op != WINED3D_TOP_SELECT_ARG1)
|| ((alpha_arg3 == WINED3DTA_TEXTURE)
&& (alpha_op == WINED3DTOP_MULTIPLYADD || alpha_op == WINED3DTOP_LERP)))
&& (alpha_op == WINED3D_TOP_MULTIPLY_ADD || alpha_op == WINED3D_TOP_LERP)))
device->fixed_function_usage_map |= (1 << i);
if ((color_op == WINED3DTOP_BUMPENVMAP || color_op == WINED3DTOP_BUMPENVMAPLUMINANCE) && i < MAX_TEXTURES - 1)
if ((color_op == WINED3D_TOP_BUMPENVMAP || color_op == WINED3D_TOP_BUMPENVMAP_LUMINANCE)
&& i < MAX_TEXTURES - 1)
device->fixed_function_usage_map |= (1 << (i + 1));
}
}
......@@ -3644,7 +3644,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
{
unsigned int i;
if (value == WINED3DTOP_DISABLE && old_value != WINED3DTOP_DISABLE)
if (value == WINED3D_TOP_DISABLE && old_value != WINED3D_TOP_DISABLE)
{
/* Previously enabled stage disabled now. Make sure to dirtify
* all enabled stages above stage, they have to be disabled.
......@@ -3658,7 +3658,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
device->stateBlock->state.lowest_disabled_stage = stage;
TRACE("New lowest disabled: %u.\n", stage);
}
else if (value != WINED3DTOP_DISABLE && old_value == WINED3DTOP_DISABLE)
else if (value != WINED3D_TOP_DISABLE && old_value == WINED3D_TOP_DISABLE)
{
/* Previously disabled stage enabled. Stages above it may need
* enabling. Stage must be lowest_disabled_stage here, if it's
......@@ -3670,7 +3670,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
* handled below. */
for (i = stage + 1; i < gl_info->limits.texture_stages; ++i)
{
if (device->updateStateBlock->state.texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3DTOP_DISABLE)
if (device->updateStateBlock->state.texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_DISABLE)
break;
TRACE("Additionally dirtifying stage %u due to enable.\n", i);
device_invalidate_state(device, STATE_TEXTURESTAGE(i, WINED3D_TSS_COLOR_OP));
......
......@@ -1072,7 +1072,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
stateblock->device->stateBlock->state.lowest_disabled_stage = MAX_TEXTURES - 1;
for (i = 0; i < MAX_TEXTURES - 1; ++i)
{
if (stateblock->device->stateBlock->state.texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3DTOP_DISABLE)
if (stateblock->device->stateBlock->state.texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_DISABLE)
{
stateblock->device->stateBlock->state.lowest_disabled_stage = i;
break;
......@@ -1254,10 +1254,10 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
{
TRACE("Setting up default texture states for texture Stage %u.\n", i);
memcpy(&state->transforms[WINED3DTS_TEXTURE0 + i], identity, sizeof(identity));
state->texture_states[i][WINED3D_TSS_COLOR_OP] = i ? WINED3DTOP_DISABLE : WINED3DTOP_MODULATE;
state->texture_states[i][WINED3D_TSS_COLOR_OP] = i ? WINED3D_TOP_DISABLE : WINED3D_TOP_MODULATE;
state->texture_states[i][WINED3D_TSS_COLOR_ARG1] = WINED3DTA_TEXTURE;
state->texture_states[i][WINED3D_TSS_COLOR_ARG2] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3D_TSS_ALPHA_OP] = i ? WINED3DTOP_DISABLE : WINED3DTOP_SELECTARG1;
state->texture_states[i][WINED3D_TSS_ALPHA_OP] = i ? WINED3D_TOP_DISABLE : WINED3D_TOP_SELECT_ARG1;
state->texture_states[i][WINED3D_TSS_ALPHA_ARG1] = WINED3DTA_TEXTURE;
state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3D_TSS_BUMPENV_MAT00] = 0;
......
......@@ -2227,38 +2227,40 @@ const char *debug_d3dtexturestate(enum wined3d_texture_stage_state state)
}
}
const char* debug_d3dtop(WINED3DTEXTUREOP d3dtop) {
switch (d3dtop) {
const char *debug_d3dtop(enum wined3d_texture_op d3dtop)
{
switch (d3dtop)
{
#define D3DTOP_TO_STR(u) case u: return #u
D3DTOP_TO_STR(WINED3DTOP_DISABLE);
D3DTOP_TO_STR(WINED3DTOP_SELECTARG1);
D3DTOP_TO_STR(WINED3DTOP_SELECTARG2);
D3DTOP_TO_STR(WINED3DTOP_MODULATE);
D3DTOP_TO_STR(WINED3DTOP_MODULATE2X);
D3DTOP_TO_STR(WINED3DTOP_MODULATE4X);
D3DTOP_TO_STR(WINED3DTOP_ADD);
D3DTOP_TO_STR(WINED3DTOP_ADDSIGNED);
D3DTOP_TO_STR(WINED3DTOP_ADDSIGNED2X);
D3DTOP_TO_STR(WINED3DTOP_SUBTRACT);
D3DTOP_TO_STR(WINED3DTOP_ADDSMOOTH);
D3DTOP_TO_STR(WINED3DTOP_BLENDDIFFUSEALPHA);
D3DTOP_TO_STR(WINED3DTOP_BLENDTEXTUREALPHA);
D3DTOP_TO_STR(WINED3DTOP_BLENDFACTORALPHA);
D3DTOP_TO_STR(WINED3DTOP_BLENDTEXTUREALPHAPM);
D3DTOP_TO_STR(WINED3DTOP_BLENDCURRENTALPHA);
D3DTOP_TO_STR(WINED3DTOP_PREMODULATE);
D3DTOP_TO_STR(WINED3DTOP_MODULATEALPHA_ADDCOLOR);
D3DTOP_TO_STR(WINED3DTOP_MODULATECOLOR_ADDALPHA);
D3DTOP_TO_STR(WINED3DTOP_MODULATEINVALPHA_ADDCOLOR);
D3DTOP_TO_STR(WINED3DTOP_MODULATEINVCOLOR_ADDALPHA);
D3DTOP_TO_STR(WINED3DTOP_BUMPENVMAP);
D3DTOP_TO_STR(WINED3DTOP_BUMPENVMAPLUMINANCE);
D3DTOP_TO_STR(WINED3DTOP_DOTPRODUCT3);
D3DTOP_TO_STR(WINED3DTOP_MULTIPLYADD);
D3DTOP_TO_STR(WINED3DTOP_LERP);
D3DTOP_TO_STR(WINED3D_TOP_DISABLE);
D3DTOP_TO_STR(WINED3D_TOP_SELECT_ARG1);
D3DTOP_TO_STR(WINED3D_TOP_SELECT_ARG2);
D3DTOP_TO_STR(WINED3D_TOP_MODULATE);
D3DTOP_TO_STR(WINED3D_TOP_MODULATE_2X);
D3DTOP_TO_STR(WINED3D_TOP_MODULATE_4X);
D3DTOP_TO_STR(WINED3D_TOP_ADD);
D3DTOP_TO_STR(WINED3D_TOP_ADD_SIGNED);
D3DTOP_TO_STR(WINED3D_TOP_ADD_SIGNED_2X);
D3DTOP_TO_STR(WINED3D_TOP_SUBTRACT);
D3DTOP_TO_STR(WINED3D_TOP_ADD_SMOOTH);
D3DTOP_TO_STR(WINED3D_TOP_BLEND_DIFFUSE_ALPHA);
D3DTOP_TO_STR(WINED3D_TOP_BLEND_TEXTURE_ALPHA);
D3DTOP_TO_STR(WINED3D_TOP_BLEND_FACTOR_ALPHA);
D3DTOP_TO_STR(WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM);
D3DTOP_TO_STR(WINED3D_TOP_BLEND_CURRENT_ALPHA);
D3DTOP_TO_STR(WINED3D_TOP_PREMODULATE);
D3DTOP_TO_STR(WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR);
D3DTOP_TO_STR(WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA);
D3DTOP_TO_STR(WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR);
D3DTOP_TO_STR(WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA);
D3DTOP_TO_STR(WINED3D_TOP_BUMPENVMAP);
D3DTOP_TO_STR(WINED3D_TOP_BUMPENVMAP_LUMINANCE);
D3DTOP_TO_STR(WINED3D_TOP_DOTPRODUCT3);
D3DTOP_TO_STR(WINED3D_TOP_MULTIPLY_ADD);
D3DTOP_TO_STR(WINED3D_TOP_LERP);
#undef D3DTOP_TO_STR
default:
FIXME("Unrecognized %u WINED3DTOP\n", d3dtop);
FIXME("Unrecognized texture op %#x.\n", d3dtop);
return "unrecognized";
}
}
......@@ -2478,17 +2480,22 @@ const char *debug_surflocation(DWORD flag) {
}
BOOL is_invalid_op(const struct wined3d_state *state, int stage,
WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3)
enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3)
{
if (op == WINED3DTOP_DISABLE) return FALSE;
if (state->textures[stage]) return FALSE;
if (op == WINED3D_TOP_DISABLE)
return FALSE;
if (state->textures[stage])
return FALSE;
if ((arg1 & WINED3DTA_SELECTMASK) == WINED3DTA_TEXTURE
&& op != WINED3DTOP_SELECTARG2) return TRUE;
&& op != WINED3D_TOP_SELECT_ARG2)
return TRUE;
if ((arg2 & WINED3DTA_SELECTMASK) == WINED3DTA_TEXTURE
&& op != WINED3DTOP_SELECTARG1) return TRUE;
&& op != WINED3D_TOP_SELECT_ARG1)
return TRUE;
if ((arg3 & WINED3DTA_SELECTMASK) == WINED3DTA_TEXTURE
&& (op == WINED3DTOP_MULTIPLYADD || op == WINED3DTOP_LERP)) return TRUE;
&& (op == WINED3D_TOP_MULTIPLY_ADD || op == WINED3D_TOP_LERP))
return TRUE;
return FALSE;
}
......@@ -2859,7 +2866,8 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
#define ARG1 0x01
#define ARG2 0x02
#define ARG0 0x04
static const unsigned char args[WINED3DTOP_LERP + 1] = {
static const unsigned char args[WINED3D_TOP_LERP + 1] =
{
/* undefined */ 0,
/* D3DTOP_DISABLE */ 0,
/* D3DTOP_SELECTARG1 */ ARG1,
......@@ -2899,10 +2907,10 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
const struct wined3d_texture *texture;
settings->op[i].padding = 0;
if (state->texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3DTOP_DISABLE)
if (state->texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_DISABLE)
{
settings->op[i].cop = WINED3DTOP_DISABLE;
settings->op[i].aop = WINED3DTOP_DISABLE;
settings->op[i].cop = WINED3D_TOP_DISABLE;
settings->op[i].aop = WINED3D_TOP_DISABLE;
settings->op[i].carg0 = settings->op[i].carg1 = settings->op[i].carg2 = ARG_UNUSED;
settings->op[i].aarg0 = settings->op[i].aarg1 = settings->op[i].aarg2 = ARG_UNUSED;
settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
......@@ -2958,10 +2966,11 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
carg0 = ARG_UNUSED;
carg2 = ARG_UNUSED;
carg1 = WINED3DTA_CURRENT;
cop = WINED3DTOP_SELECTARG1;
cop = WINED3D_TOP_SELECT_ARG1;
}
if(cop == WINED3DTOP_DOTPRODUCT3) {
if (cop == WINED3D_TOP_DOTPRODUCT3)
{
/* A dotproduct3 on the colorop overwrites the alphaop operation and replicates
* the color result to the alpha component of the destination
*/
......@@ -2990,26 +2999,26 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
if (surf->CKeyFlags & WINEDDSD_CKSRCBLT && !surf->resource.format->alpha_mask)
{
if (aop == WINED3DTOP_DISABLE)
if (aop == WINED3D_TOP_DISABLE)
{
aarg1 = WINED3DTA_TEXTURE;
aop = WINED3DTOP_SELECTARG1;
aop = WINED3D_TOP_SELECT_ARG1;
}
else if (aop == WINED3DTOP_SELECTARG1 && aarg1 != WINED3DTA_TEXTURE)
else if (aop == WINED3D_TOP_SELECT_ARG1 && aarg1 != WINED3DTA_TEXTURE)
{
if (state->render_states[WINED3D_RS_ALPHABLENDENABLE])
{
aarg2 = WINED3DTA_TEXTURE;
aop = WINED3DTOP_MODULATE;
aop = WINED3D_TOP_MODULATE;
}
else aarg1 = WINED3DTA_TEXTURE;
}
else if (aop == WINED3DTOP_SELECTARG2 && aarg2 != WINED3DTA_TEXTURE)
else if (aop == WINED3D_TOP_SELECT_ARG2 && aarg2 != WINED3DTA_TEXTURE)
{
if (state->render_states[WINED3D_RS_ALPHABLENDENABLE])
{
aarg1 = WINED3DTA_TEXTURE;
aop = WINED3DTOP_MODULATE;
aop = WINED3D_TOP_MODULATE;
}
else aarg2 = WINED3DTA_TEXTURE;
}
......@@ -3022,7 +3031,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
aarg0 = ARG_UNUSED;
aarg2 = ARG_UNUSED;
aarg1 = WINED3DTA_CURRENT;
aop = WINED3DTOP_SELECTARG1;
aop = WINED3D_TOP_SELECT_ARG1;
}
if (carg1 == WINED3DTA_TEXTURE || carg2 == WINED3DTA_TEXTURE || carg0 == WINED3DTA_TEXTURE
......
......@@ -2510,14 +2510,14 @@ const char *debug_fbostatus(GLenum status) DECLSPEC_HIDDEN;
const char *debug_glerror(GLenum error) DECLSPEC_HIDDEN;
const char *debug_d3dbasis(WINED3DBASISTYPE basis) DECLSPEC_HIDDEN;
const char *debug_d3ddegree(enum wined3d_degree_type order) DECLSPEC_HIDDEN;
const char *debug_d3dtop(WINED3DTEXTUREOP d3dtop) DECLSPEC_HIDDEN;
const char *debug_d3dtop(enum wined3d_texture_op d3dtop) DECLSPEC_HIDDEN;
void dump_color_fixup_desc(struct color_fixup_desc fixup) DECLSPEC_HIDDEN;
const char *debug_surflocation(DWORD flag) DECLSPEC_HIDDEN;
BOOL is_invalid_op(const struct wined3d_state *state, int stage,
WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) DECLSPEC_HIDDEN;
enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3) 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,
BOOL is_alpha, int stage, enum wined3d_texture_op 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;
......
......@@ -582,36 +582,35 @@ enum wined3d_texture_transform_flags
WINED3D_TTFF_PROJECTED = 256,
};
typedef enum _WINED3DTEXTUREOP
{
WINED3DTOP_DISABLE = 1,
WINED3DTOP_SELECTARG1 = 2,
WINED3DTOP_SELECTARG2 = 3,
WINED3DTOP_MODULATE = 4,
WINED3DTOP_MODULATE2X = 5,
WINED3DTOP_MODULATE4X = 6,
WINED3DTOP_ADD = 7,
WINED3DTOP_ADDSIGNED = 8,
WINED3DTOP_ADDSIGNED2X = 9,
WINED3DTOP_SUBTRACT = 10,
WINED3DTOP_ADDSMOOTH = 11,
WINED3DTOP_BLENDDIFFUSEALPHA = 12,
WINED3DTOP_BLENDTEXTUREALPHA = 13,
WINED3DTOP_BLENDFACTORALPHA = 14,
WINED3DTOP_BLENDTEXTUREALPHAPM = 15,
WINED3DTOP_BLENDCURRENTALPHA = 16,
WINED3DTOP_PREMODULATE = 17,
WINED3DTOP_MODULATEALPHA_ADDCOLOR = 18,
WINED3DTOP_MODULATECOLOR_ADDALPHA = 19,
WINED3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
WINED3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
WINED3DTOP_BUMPENVMAP = 22,
WINED3DTOP_BUMPENVMAPLUMINANCE = 23,
WINED3DTOP_DOTPRODUCT3 = 24,
WINED3DTOP_MULTIPLYADD = 25,
WINED3DTOP_LERP = 26,
WINED3DTOP_FORCE_DWORD = 0x7fffffff,
} WINED3DTEXTUREOP;
enum wined3d_texture_op
{
WINED3D_TOP_DISABLE = 1,
WINED3D_TOP_SELECT_ARG1 = 2,
WINED3D_TOP_SELECT_ARG2 = 3,
WINED3D_TOP_MODULATE = 4,
WINED3D_TOP_MODULATE_2X = 5,
WINED3D_TOP_MODULATE_4X = 6,
WINED3D_TOP_ADD = 7,
WINED3D_TOP_ADD_SIGNED = 8,
WINED3D_TOP_ADD_SIGNED_2X = 9,
WINED3D_TOP_SUBTRACT = 10,
WINED3D_TOP_ADD_SMOOTH = 11,
WINED3D_TOP_BLEND_DIFFUSE_ALPHA = 12,
WINED3D_TOP_BLEND_TEXTURE_ALPHA = 13,
WINED3D_TOP_BLEND_FACTOR_ALPHA = 14,
WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM = 15,
WINED3D_TOP_BLEND_CURRENT_ALPHA = 16,
WINED3D_TOP_PREMODULATE = 17,
WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR = 18,
WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA = 19,
WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR = 20,
WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA = 21,
WINED3D_TOP_BUMPENVMAP = 22,
WINED3D_TOP_BUMPENVMAP_LUMINANCE = 23,
WINED3D_TOP_DOTPRODUCT3 = 24,
WINED3D_TOP_MULTIPLY_ADD = 25,
WINED3D_TOP_LERP = 26,
};
typedef enum _WINED3DTEXTUREADDRESS
{
......
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