Commit 43fcbcb3 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the WINED3DTEXTURESTAGESTATETYPE typedef.

parent 40e8d854
......@@ -1729,23 +1729,23 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(IDirect3DDevice8 *iface, D
static const struct tss_lookup
{
BOOL sampler_state;
DWORD state;
enum wined3d_texture_stage_state state;
}
tss_lookup[] =
{
{FALSE, WINED3DTSS_FORCE_DWORD}, /* 0, unused */
{FALSE, WINED3DTSS_COLOROP}, /* 1, D3DTSS_COLOROP */
{FALSE, WINED3DTSS_COLORARG1}, /* 2, D3DTSS_COLORARG1 */
{FALSE, WINED3DTSS_COLORARG2}, /* 3, D3DTSS_COLORARG2 */
{FALSE, WINED3DTSS_ALPHAOP}, /* 4, D3DTSS_ALPHAOP */
{FALSE, WINED3DTSS_ALPHAARG1}, /* 5, D3DTSS_ALPHAARG1 */
{FALSE, WINED3DTSS_ALPHAARG2}, /* 6, D3DTSS_ALPHAARG2 */
{FALSE, WINED3DTSS_BUMPENVMAT00}, /* 7, D3DTSS_BUMPENVMAT00 */
{FALSE, WINED3DTSS_BUMPENVMAT01}, /* 8, D3DTSS_BUMPENVMAT01 */
{FALSE, WINED3DTSS_BUMPENVMAT10}, /* 9, D3DTSS_BUMPENVMAT10 */
{FALSE, WINED3DTSS_BUMPENVMAT11}, /* 10, D3DTSS_BUMPENVMAT11 */
{FALSE, WINED3DTSS_TEXCOORDINDEX}, /* 11, D3DTSS_TEXCOORDINDEX */
{FALSE, WINED3DTSS_FORCE_DWORD}, /* 12, unused */
{FALSE, WINED3D_TSS_INVALID}, /* 0, unused */
{FALSE, WINED3D_TSS_COLOR_OP}, /* 1, D3DTSS_COLOROP */
{FALSE, WINED3D_TSS_COLOR_ARG1}, /* 2, D3DTSS_COLORARG1 */
{FALSE, WINED3D_TSS_COLOR_ARG2}, /* 3, D3DTSS_COLORARG2 */
{FALSE, WINED3D_TSS_ALPHA_OP}, /* 4, D3DTSS_ALPHAOP */
{FALSE, WINED3D_TSS_ALPHA_ARG1}, /* 5, D3DTSS_ALPHAARG1 */
{FALSE, WINED3D_TSS_ALPHA_ARG2}, /* 6, D3DTSS_ALPHAARG2 */
{FALSE, WINED3D_TSS_BUMPENV_MAT00}, /* 7, D3DTSS_BUMPENVMAT00 */
{FALSE, WINED3D_TSS_BUMPENV_MAT01}, /* 8, D3DTSS_BUMPENVMAT01 */
{FALSE, WINED3D_TSS_BUMPENV_MAT10}, /* 9, D3DTSS_BUMPENVMAT10 */
{FALSE, WINED3D_TSS_BUMPENV_MAT11}, /* 10, D3DTSS_BUMPENVMAT11 */
{FALSE, WINED3D_TSS_TEXCOORD_INDEX}, /* 11, D3DTSS_TEXCOORDINDEX */
{FALSE, WINED3D_TSS_INVALID}, /* 12, unused */
{TRUE, WINED3D_SAMP_ADDRESS_U}, /* 13, D3DTSS_ADDRESSU */
{TRUE, WINED3D_SAMP_ADDRESS_V}, /* 14, D3DTSS_ADDRESSV */
{TRUE, WINED3D_SAMP_BORDER_COLOR}, /* 15, D3DTSS_BORDERCOLOR */
......@@ -1755,13 +1755,13 @@ tss_lookup[] =
{TRUE, WINED3D_SAMP_MIPMAP_LOD_BIAS}, /* 19, D3DTSS_MIPMAPLODBIAS */
{TRUE, WINED3D_SAMP_MAX_MIP_LEVEL}, /* 20, D3DTSS_MAXMIPLEVEL */
{TRUE, WINED3D_SAMP_MAX_ANISOTROPY}, /* 21, D3DTSS_MAXANISOTROPY */
{FALSE, WINED3DTSS_BUMPENVLSCALE}, /* 22, D3DTSS_BUMPENVLSCALE */
{FALSE, WINED3DTSS_BUMPENVLOFFSET}, /* 23, D3DTSS_BUMPENVLOFFSET */
{FALSE, WINED3DTSS_TEXTURETRANSFORMFLAGS}, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
{FALSE, WINED3D_TSS_BUMPENV_LSCALE}, /* 22, D3DTSS_BUMPENVLSCALE */
{FALSE, WINED3D_TSS_BUMPENV_LOFFSET}, /* 23, D3DTSS_BUMPENVLOFFSET */
{FALSE, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS}, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
{TRUE, WINED3D_SAMP_ADDRESS_W}, /* 25, D3DTSS_ADDRESSW */
{FALSE, WINED3DTSS_COLORARG0}, /* 26, D3DTSS_COLORARG0 */
{FALSE, WINED3DTSS_ALPHAARG0}, /* 27, D3DTSS_ALPHAARG0 */
{FALSE, WINED3DTSS_RESULTARG}, /* 28, D3DTSS_RESULTARG */
{FALSE, WINED3D_TSS_COLOR_ARG0}, /* 26, D3DTSS_COLORARG0 */
{FALSE, WINED3D_TSS_ALPHA_ARG0}, /* 27, D3DTSS_ALPHAARG0 */
{FALSE, WINED3D_TSS_RESULT_ARG}, /* 28, D3DTSS_RESULTARG */
};
static HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(IDirect3DDevice8 *iface,
......
......@@ -1697,41 +1697,41 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(IDirect3DDevice9Ex *iface,
return hr;
}
static const WINED3DTEXTURESTAGESTATETYPE tss_lookup[] =
{
WINED3DTSS_FORCE_DWORD, /* 0, unused */
WINED3DTSS_COLOROP, /* 1, D3DTSS_COLOROP */
WINED3DTSS_COLORARG1, /* 2, D3DTSS_COLORARG1 */
WINED3DTSS_COLORARG2, /* 3, D3DTSS_COLORARG2 */
WINED3DTSS_ALPHAOP, /* 4, D3DTSS_ALPHAOP */
WINED3DTSS_ALPHAARG1, /* 5, D3DTSS_ALPHAARG1 */
WINED3DTSS_ALPHAARG2, /* 6, D3DTSS_ALPHAARG2 */
WINED3DTSS_BUMPENVMAT00, /* 7, D3DTSS_BUMPENVMAT00 */
WINED3DTSS_BUMPENVMAT01, /* 8, D3DTSS_BUMPENVMAT01 */
WINED3DTSS_BUMPENVMAT10, /* 9, D3DTSS_BUMPENVMAT10 */
WINED3DTSS_BUMPENVMAT11, /* 10, D3DTSS_BUMPENVMAT11 */
WINED3DTSS_TEXCOORDINDEX, /* 11, D3DTSS_TEXCOORDINDEX */
WINED3DTSS_FORCE_DWORD, /* 12, unused */
WINED3DTSS_FORCE_DWORD, /* 13, unused */
WINED3DTSS_FORCE_DWORD, /* 14, unused */
WINED3DTSS_FORCE_DWORD, /* 15, unused */
WINED3DTSS_FORCE_DWORD, /* 16, unused */
WINED3DTSS_FORCE_DWORD, /* 17, unused */
WINED3DTSS_FORCE_DWORD, /* 18, unused */
WINED3DTSS_FORCE_DWORD, /* 19, unused */
WINED3DTSS_FORCE_DWORD, /* 20, unused */
WINED3DTSS_FORCE_DWORD, /* 21, unused */
WINED3DTSS_BUMPENVLSCALE, /* 22, D3DTSS_BUMPENVLSCALE */
WINED3DTSS_BUMPENVLOFFSET, /* 23, D3DTSS_BUMPENVLOFFSET */
WINED3DTSS_TEXTURETRANSFORMFLAGS, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
WINED3DTSS_FORCE_DWORD, /* 25, unused */
WINED3DTSS_COLORARG0, /* 26, D3DTSS_COLORARG0 */
WINED3DTSS_ALPHAARG0, /* 27, D3DTSS_ALPHAARG0 */
WINED3DTSS_RESULTARG, /* 28, D3DTSS_RESULTARG */
WINED3DTSS_FORCE_DWORD, /* 29, unused */
WINED3DTSS_FORCE_DWORD, /* 30, unused */
WINED3DTSS_FORCE_DWORD, /* 31, unused */
WINED3DTSS_CONSTANT, /* 32, D3DTSS_CONSTANT */
static const enum wined3d_texture_stage_state tss_lookup[] =
{
WINED3D_TSS_INVALID, /* 0, unused */
WINED3D_TSS_COLOR_OP, /* 1, D3DTSS_COLOROP */
WINED3D_TSS_COLOR_ARG1, /* 2, D3DTSS_COLORARG1 */
WINED3D_TSS_COLOR_ARG2, /* 3, D3DTSS_COLORARG2 */
WINED3D_TSS_ALPHA_OP, /* 4, D3DTSS_ALPHAOP */
WINED3D_TSS_ALPHA_ARG1, /* 5, D3DTSS_ALPHAARG1 */
WINED3D_TSS_ALPHA_ARG2, /* 6, D3DTSS_ALPHAARG2 */
WINED3D_TSS_BUMPENV_MAT00, /* 7, D3DTSS_BUMPENVMAT00 */
WINED3D_TSS_BUMPENV_MAT01, /* 8, D3DTSS_BUMPENVMAT01 */
WINED3D_TSS_BUMPENV_MAT10, /* 9, D3DTSS_BUMPENVMAT10 */
WINED3D_TSS_BUMPENV_MAT11, /* 10, D3DTSS_BUMPENVMAT11 */
WINED3D_TSS_TEXCOORD_INDEX, /* 11, D3DTSS_TEXCOORDINDEX */
WINED3D_TSS_INVALID, /* 12, unused */
WINED3D_TSS_INVALID, /* 13, unused */
WINED3D_TSS_INVALID, /* 14, unused */
WINED3D_TSS_INVALID, /* 15, unused */
WINED3D_TSS_INVALID, /* 16, unused */
WINED3D_TSS_INVALID, /* 17, unused */
WINED3D_TSS_INVALID, /* 18, unused */
WINED3D_TSS_INVALID, /* 19, unused */
WINED3D_TSS_INVALID, /* 20, unused */
WINED3D_TSS_INVALID, /* 21, unused */
WINED3D_TSS_BUMPENV_LSCALE, /* 22, D3DTSS_BUMPENVLSCALE */
WINED3D_TSS_BUMPENV_LOFFSET, /* 23, D3DTSS_BUMPENVLOFFSET */
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
WINED3D_TSS_INVALID, /* 25, unused */
WINED3D_TSS_COLOR_ARG0, /* 26, D3DTSS_COLORARG0 */
WINED3D_TSS_ALPHA_ARG0, /* 27, D3DTSS_ALPHAARG0 */
WINED3D_TSS_RESULT_ARG, /* 28, D3DTSS_RESULTARG */
WINED3D_TSS_INVALID, /* 29, unused */
WINED3D_TSS_INVALID, /* 30, unused */
WINED3D_TSS_INVALID, /* 31, unused */
WINED3D_TSS_CONSTANT, /* 32, D3DTSS_CONSTANT */
};
static HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(IDirect3DDevice9Ex *iface,
......
......@@ -1729,7 +1729,7 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
if (sampler != WINED3D_UNMAPPED_STAGE)
{
if (sampler < MAX_TEXTURES)
context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3DTSS_COLOROP));
context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP));
context_invalidate_state(context, STATE_SAMPLER(sampler));
}
}
......@@ -1772,7 +1772,7 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
if (sampler < MAX_TEXTURES)
{
context_invalidate_state(context, STATE_TRANSFORM(WINED3DTS_TEXTURE0 + sampler));
context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3DTSS_COLOROP));
context_invalidate_state(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP));
}
context_invalidate_state(context, STATE_SAMPLER(sampler));
}
......
......@@ -2809,14 +2809,14 @@ 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][WINED3DTSS_COLOROP];
WINED3DTEXTUREOP alpha_op = state->texture_states[i][WINED3DTSS_ALPHAOP];
DWORD color_arg1 = state->texture_states[i][WINED3DTSS_COLORARG1] & WINED3DTA_SELECTMASK;
DWORD color_arg2 = state->texture_states[i][WINED3DTSS_COLORARG2] & WINED3DTA_SELECTMASK;
DWORD color_arg3 = state->texture_states[i][WINED3DTSS_COLORARG0] & WINED3DTA_SELECTMASK;
DWORD alpha_arg1 = state->texture_states[i][WINED3DTSS_ALPHAARG1] & WINED3DTA_SELECTMASK;
DWORD alpha_arg2 = state->texture_states[i][WINED3DTSS_ALPHAARG2] & WINED3DTA_SELECTMASK;
DWORD alpha_arg3 = state->texture_states[i][WINED3DTSS_ALPHAARG0] & WINED3DTA_SELECTMASK;
WINED3DTEXTUREOP color_op = state->texture_states[i][WINED3D_TSS_COLOR_OP];
WINED3DTEXTUREOP 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;
DWORD alpha_arg1 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG1] & WINED3DTA_SELECTMASK;
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 */
......@@ -3589,7 +3589,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
}
HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device,
UINT stage, WINED3DTEXTURESTAGESTATETYPE state, DWORD value)
UINT stage, enum wined3d_texture_stage_state state, DWORD value)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
DWORD old_value;
......@@ -3629,7 +3629,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
if (stage > device->stateBlock->state.lowest_disabled_stage
&& device->StateTable[STATE_TEXTURESTAGE(0, state)].representative
== STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP))
== STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP))
{
/* Colorop change above lowest disabled stage? That won't change
* anything in the GL setup. Changes in other states are important on
......@@ -3637,7 +3637,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
return WINED3D_OK;
}
if (state == WINED3DTSS_COLOROP)
if (state == WINED3D_TSS_COLOR_OP)
{
unsigned int i;
......@@ -3650,7 +3650,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
for (i = stage + 1; i < device->stateBlock->state.lowest_disabled_stage; ++i)
{
TRACE("Additionally dirtifying stage %u.\n", i);
device_invalidate_state(device, STATE_TEXTURESTAGE(i, WINED3DTSS_COLOROP));
device_invalidate_state(device, STATE_TEXTURESTAGE(i, WINED3D_TSS_COLOR_OP));
}
device->stateBlock->state.lowest_disabled_stage = stage;
TRACE("New lowest disabled: %u.\n", stage);
......@@ -3667,10 +3667,10 @@ 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][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE)
if (device->updateStateBlock->state.texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3DTOP_DISABLE)
break;
TRACE("Additionally dirtifying stage %u due to enable.\n", i);
device_invalidate_state(device, STATE_TEXTURESTAGE(i, WINED3DTSS_COLOROP));
device_invalidate_state(device, STATE_TEXTURESTAGE(i, WINED3D_TSS_COLOR_OP));
}
device->stateBlock->state.lowest_disabled_stage = i;
TRACE("New lowest disabled: %u.\n", i);
......@@ -3683,7 +3683,7 @@ HRESULT CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *devi
}
HRESULT CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
UINT stage, WINED3DTEXTURESTAGESTATETYPE state, DWORD *value)
UINT stage, enum wined3d_texture_stage_state state, DWORD *value)
{
TRACE("device %p, stage %u, state %s, value %p.\n",
device, stage, debug_d3dtexturestate(state), value);
......@@ -3761,10 +3761,10 @@ HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device,
if (!prev && stage < gl_info->limits.texture_stages)
{
/* The source arguments for color and alpha ops have different
* meanings when a NULL texture is bound, so the COLOROP and
* ALPHAOP have to be dirtified. */
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3DTSS_COLOROP));
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3DTSS_ALPHAOP));
* meanings when a NULL texture is bound, so the COLOR_OP and
* ALPHA_OP have to be dirtified. */
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP));
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP));
}
if (bind_count == 1)
......@@ -3779,8 +3779,8 @@ HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device,
if (!texture && stage < gl_info->limits.texture_stages)
{
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3DTSS_COLOROP));
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3DTSS_ALPHAOP));
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP));
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP));
}
if (bind_count && prev->sampler == stage)
......
......@@ -173,7 +173,7 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi
for (textureNo = 0; textureNo < texture_stages; ++textureNo)
{
int coordIdx = state->texture_states[textureNo][WINED3DTSS_TEXCOORDINDEX];
int coordIdx = state->texture_states[textureNo][WINED3D_TSS_TEXCOORD_INDEX];
DWORD texture_idx = device->texUnitMap[textureNo];
if (!gl_info->supported[ARB_MULTITEXTURE] && textureNo > 0)
......@@ -243,7 +243,7 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi
if (!(tmp_tex_mask & 1)) continue;
coord_idx = state->texture_states[texture][WINED3DTSS_TEXCOORDINDEX];
coord_idx = state->texture_states[texture][WINED3D_TSS_TEXCOORD_INDEX];
ptr = texCoords[coord_idx] + (SkipnStrides * si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx].stride);
texture_idx = device->texUnitMap[texture];
......
......@@ -776,7 +776,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
if(prog->bumpenvmat_location[i] == -1) continue;
data = (const float *)&state->texture_states[i][WINED3DTSS_BUMPENVMAT00];
data = (const float *)&state->texture_states[i][WINED3D_TSS_BUMPENV_MAT00];
GL_EXTCALL(glUniformMatrix2fvARB(prog->bumpenvmat_location[i], 1, 0, data));
checkGLcall("glUniformMatrix2fvARB");
......@@ -785,8 +785,8 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
* needsbumpmat check. */
if (prog->luminancescale_location[i] != -1)
{
const GLfloat *scale = (const GLfloat *)&state->texture_states[i][WINED3DTSS_BUMPENVLSCALE];
const GLfloat *offset = (const GLfloat *)&state->texture_states[i][WINED3DTSS_BUMPENVLOFFSET];
const GLfloat *scale = (const GLfloat *)&state->texture_states[i][WINED3D_TSS_BUMPENV_LSCALE];
const GLfloat *offset = (const GLfloat *)&state->texture_states[i][WINED3D_TSS_BUMPENV_LOFFSET];
GL_EXTCALL(glUniform1fvARB(prog->luminancescale_location[i], 1, scale));
checkGLcall("glUniform1fvARB");
......
......@@ -1910,7 +1910,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
{
for (i = 0; i < 4; ++i)
{
DWORD flags = state->texture_states[i][WINED3DTSS_TEXTURETRANSFORMFLAGS];
DWORD flags = state->texture_states[i][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS];
if (flags & WINED3DTTFF_PROJECTED)
{
......@@ -1921,7 +1921,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
if (!state->vertex_shader)
{
unsigned int j;
unsigned int index = state->texture_states[i][WINED3DTSS_TEXCOORDINDEX];
unsigned int index = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
for (j = 0; j < state->vertex_declaration->element_count; ++j)
{
struct wined3d_vertex_declaration_element *element =
......
......@@ -93,23 +93,23 @@ static const DWORD pixel_states_render[] =
static const DWORD pixel_states_texture[] =
{
WINED3DTSS_ALPHAARG0,
WINED3DTSS_ALPHAARG1,
WINED3DTSS_ALPHAARG2,
WINED3DTSS_ALPHAOP,
WINED3DTSS_BUMPENVLOFFSET,
WINED3DTSS_BUMPENVLSCALE,
WINED3DTSS_BUMPENVMAT00,
WINED3DTSS_BUMPENVMAT01,
WINED3DTSS_BUMPENVMAT10,
WINED3DTSS_BUMPENVMAT11,
WINED3DTSS_COLORARG0,
WINED3DTSS_COLORARG1,
WINED3DTSS_COLORARG2,
WINED3DTSS_COLOROP,
WINED3DTSS_RESULTARG,
WINED3DTSS_TEXCOORDINDEX,
WINED3DTSS_TEXTURETRANSFORMFLAGS,
WINED3D_TSS_ALPHA_ARG0,
WINED3D_TSS_ALPHA_ARG1,
WINED3D_TSS_ALPHA_ARG2,
WINED3D_TSS_ALPHA_OP,
WINED3D_TSS_BUMPENV_LOFFSET,
WINED3D_TSS_BUMPENV_LSCALE,
WINED3D_TSS_BUMPENV_MAT00,
WINED3D_TSS_BUMPENV_MAT01,
WINED3D_TSS_BUMPENV_MAT10,
WINED3D_TSS_BUMPENV_MAT11,
WINED3D_TSS_COLOR_ARG0,
WINED3D_TSS_COLOR_ARG1,
WINED3D_TSS_COLOR_ARG2,
WINED3D_TSS_COLOR_OP,
WINED3D_TSS_RESULT_ARG,
WINED3D_TSS_TEXCOORD_INDEX,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS,
};
static const DWORD pixel_states_sampler[] =
......@@ -179,8 +179,8 @@ static const DWORD vertex_states_render[] =
static const DWORD vertex_states_texture[] =
{
WINED3DTSS_TEXCOORDINDEX,
WINED3DTSS_TEXTURETRANSFORMFLAGS,
WINED3D_TSS_TEXCOORD_INDEX,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS,
};
static const DWORD vertex_states_sampler[] =
......@@ -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][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE)
if (stateblock->device->stateBlock->state.texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3DTOP_DISABLE)
{
stateblock->device->stateBlock->state.lowest_disabled_stage = i;
break;
......@@ -1254,23 +1254,23 @@ 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][WINED3DTSS_COLOROP] = i ? WINED3DTOP_DISABLE : WINED3DTOP_MODULATE;
state->texture_states[i][WINED3DTSS_COLORARG1] = WINED3DTA_TEXTURE;
state->texture_states[i][WINED3DTSS_COLORARG2] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3DTSS_ALPHAOP] = i ? WINED3DTOP_DISABLE : WINED3DTOP_SELECTARG1;
state->texture_states[i][WINED3DTSS_ALPHAARG1] = WINED3DTA_TEXTURE;
state->texture_states[i][WINED3DTSS_ALPHAARG2] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3DTSS_BUMPENVMAT00] = 0;
state->texture_states[i][WINED3DTSS_BUMPENVMAT01] = 0;
state->texture_states[i][WINED3DTSS_BUMPENVMAT10] = 0;
state->texture_states[i][WINED3DTSS_BUMPENVMAT11] = 0;
state->texture_states[i][WINED3DTSS_TEXCOORDINDEX] = i;
state->texture_states[i][WINED3DTSS_BUMPENVLSCALE] = 0;
state->texture_states[i][WINED3DTSS_BUMPENVLOFFSET] = 0;
state->texture_states[i][WINED3DTSS_TEXTURETRANSFORMFLAGS] = WINED3DTTFF_DISABLE;
state->texture_states[i][WINED3DTSS_COLORARG0] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3DTSS_ALPHAARG0] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3DTSS_RESULTARG] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3D_TSS_COLOR_OP] = i ? WINED3DTOP_DISABLE : WINED3DTOP_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_ARG1] = WINED3DTA_TEXTURE;
state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3D_TSS_BUMPENV_MAT00] = 0;
state->texture_states[i][WINED3D_TSS_BUMPENV_MAT01] = 0;
state->texture_states[i][WINED3D_TSS_BUMPENV_MAT10] = 0;
state->texture_states[i][WINED3D_TSS_BUMPENV_MAT11] = 0;
state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] = i;
state->texture_states[i][WINED3D_TSS_BUMPENV_LSCALE] = 0;
state->texture_states[i][WINED3D_TSS_BUMPENV_LOFFSET] = 0;
state->texture_states[i][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS] = WINED3DTTFF_DISABLE;
state->texture_states[i][WINED3D_TSS_COLOR_ARG0] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3D_TSS_ALPHA_ARG0] = WINED3DTA_CURRENT;
state->texture_states[i][WINED3D_TSS_RESULT_ARG] = WINED3DTA_CURRENT;
}
state->lowest_disabled_stage = 1;
......
......@@ -2197,29 +2197,29 @@ const char *debug_d3dtexturefiltertype(WINED3DTEXTUREFILTERTYPE filter_type) {
}
}
const char *debug_d3dtexturestate(DWORD state)
const char *debug_d3dtexturestate(enum wined3d_texture_stage_state state)
{
switch (state)
{
#define D3DSTATE_TO_STR(u) case u: return #u
D3DSTATE_TO_STR(WINED3DTSS_COLOROP);
D3DSTATE_TO_STR(WINED3DTSS_COLORARG1);
D3DSTATE_TO_STR(WINED3DTSS_COLORARG2);
D3DSTATE_TO_STR(WINED3DTSS_ALPHAOP);
D3DSTATE_TO_STR(WINED3DTSS_ALPHAARG1);
D3DSTATE_TO_STR(WINED3DTSS_ALPHAARG2);
D3DSTATE_TO_STR(WINED3DTSS_BUMPENVMAT00);
D3DSTATE_TO_STR(WINED3DTSS_BUMPENVMAT01);
D3DSTATE_TO_STR(WINED3DTSS_BUMPENVMAT10);
D3DSTATE_TO_STR(WINED3DTSS_BUMPENVMAT11);
D3DSTATE_TO_STR(WINED3DTSS_TEXCOORDINDEX);
D3DSTATE_TO_STR(WINED3DTSS_BUMPENVLSCALE);
D3DSTATE_TO_STR(WINED3DTSS_BUMPENVLOFFSET);
D3DSTATE_TO_STR(WINED3DTSS_TEXTURETRANSFORMFLAGS);
D3DSTATE_TO_STR(WINED3DTSS_COLORARG0);
D3DSTATE_TO_STR(WINED3DTSS_ALPHAARG0);
D3DSTATE_TO_STR(WINED3DTSS_RESULTARG);
D3DSTATE_TO_STR(WINED3DTSS_CONSTANT);
D3DSTATE_TO_STR(WINED3D_TSS_COLOR_OP);
D3DSTATE_TO_STR(WINED3D_TSS_COLOR_ARG1);
D3DSTATE_TO_STR(WINED3D_TSS_COLOR_ARG2);
D3DSTATE_TO_STR(WINED3D_TSS_ALPHA_OP);
D3DSTATE_TO_STR(WINED3D_TSS_ALPHA_ARG1);
D3DSTATE_TO_STR(WINED3D_TSS_ALPHA_ARG2);
D3DSTATE_TO_STR(WINED3D_TSS_BUMPENV_MAT00);
D3DSTATE_TO_STR(WINED3D_TSS_BUMPENV_MAT01);
D3DSTATE_TO_STR(WINED3D_TSS_BUMPENV_MAT10);
D3DSTATE_TO_STR(WINED3D_TSS_BUMPENV_MAT11);
D3DSTATE_TO_STR(WINED3D_TSS_TEXCOORD_INDEX);
D3DSTATE_TO_STR(WINED3D_TSS_BUMPENV_LSCALE);
D3DSTATE_TO_STR(WINED3D_TSS_BUMPENV_LOFFSET);
D3DSTATE_TO_STR(WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS);
D3DSTATE_TO_STR(WINED3D_TSS_COLOR_ARG0);
D3DSTATE_TO_STR(WINED3D_TSS_ALPHA_ARG0);
D3DSTATE_TO_STR(WINED3D_TSS_RESULT_ARG);
D3DSTATE_TO_STR(WINED3D_TSS_CONSTANT);
#undef D3DSTATE_TO_STR
default:
FIXME("Unrecognized %u texture state!\n", state);
......@@ -2885,7 +2885,7 @@ 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][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE)
if (state->texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3DTOP_DISABLE)
{
settings->op[i].cop = WINED3DTOP_DISABLE;
settings->op[i].aop = WINED3DTOP_DISABLE;
......@@ -2932,12 +2932,12 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
settings->op[i].tex_type = tex_1d;
}
cop = state->texture_states[i][WINED3DTSS_COLOROP];
aop = state->texture_states[i][WINED3DTSS_ALPHAOP];
cop = state->texture_states[i][WINED3D_TSS_COLOR_OP];
aop = state->texture_states[i][WINED3D_TSS_ALPHA_OP];
carg1 = (args[cop] & ARG1) ? state->texture_states[i][WINED3DTSS_COLORARG1] : ARG_UNUSED;
carg2 = (args[cop] & ARG2) ? state->texture_states[i][WINED3DTSS_COLORARG2] : ARG_UNUSED;
carg0 = (args[cop] & ARG0) ? state->texture_states[i][WINED3DTSS_COLORARG0] : ARG_UNUSED;
carg1 = (args[cop] & ARG1) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG1] : ARG_UNUSED;
carg2 = (args[cop] & ARG2) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG2] : ARG_UNUSED;
carg0 = (args[cop] & ARG0) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG0] : ARG_UNUSED;
if (is_invalid_op(state, i, cop, carg1, carg2, carg0))
{
......@@ -2958,9 +2958,9 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
}
else
{
aarg1 = (args[aop] & ARG1) ? state->texture_states[i][WINED3DTSS_ALPHAARG1] : ARG_UNUSED;
aarg2 = (args[aop] & ARG2) ? state->texture_states[i][WINED3DTSS_ALPHAARG2] : ARG_UNUSED;
aarg0 = (args[aop] & ARG0) ? state->texture_states[i][WINED3DTSS_ALPHAARG0] : ARG_UNUSED;
aarg1 = (args[aop] & ARG1) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG1] : ARG_UNUSED;
aarg2 = (args[aop] & ARG2) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] : ARG_UNUSED;
aarg0 = (args[aop] & ARG0) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG0] : ARG_UNUSED;
}
if (!i && state->textures[0] && state->render_states[WINED3D_RS_COLORKEYENABLE])
......@@ -3014,7 +3014,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
if (carg1 == WINED3DTA_TEXTURE || carg2 == WINED3DTA_TEXTURE || carg0 == WINED3DTA_TEXTURE
|| aarg1 == WINED3DTA_TEXTURE || aarg2 == WINED3DTA_TEXTURE || aarg0 == WINED3DTA_TEXTURE)
{
ttff = state->texture_states[i][WINED3DTSS_TEXTURETRANSFORMFLAGS];
ttff = state->texture_states[i][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS];
if (ttff == (WINED3DTTFF_PROJECTED | WINED3DTTFF_COUNT3))
settings->op[i].projected = proj_count3;
else if (ttff & WINED3DTTFF_PROJECTED)
......@@ -3036,7 +3036,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s
settings->op[i].aarg1 = aarg1;
settings->op[i].aarg2 = aarg2;
if (state->texture_states[i][WINED3DTSS_RESULTARG] == WINED3DTA_TEMP)
if (state->texture_states[i][WINED3D_TSS_RESULT_ARG] == WINED3DTA_TEMP)
settings->op[i].dst = tempreg;
else
settings->op[i].dst = resultreg;
......@@ -3228,7 +3228,7 @@ void sampler_texdim(struct wined3d_context *context, const struct wined3d_state
return;
if (sampler >= state->lowest_disabled_stage)
return;
if (isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3DTSS_COLOROP)))
if (isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)))
return;
texture_activate_dimensions(state->textures[sampler], context->gl_info);
......
......@@ -2504,7 +2504,7 @@ const char *debug_d3drenderstate(enum wined3d_render_state state) DECLSPEC_HIDDE
const char *debug_d3dsamplerstate(enum wined3d_sampler_state state) DECLSPEC_HIDDEN;
const char *debug_d3dstate(DWORD state) DECLSPEC_HIDDEN;
const char *debug_d3dtexturefiltertype(WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN;
const char *debug_d3dtexturestate(DWORD state) DECLSPEC_HIDDEN;
const char *debug_d3dtexturestate(enum wined3d_texture_stage_state state) DECLSPEC_HIDDEN;
const char *debug_d3dtstype(WINED3DTRANSFORMSTATETYPE tstype) DECLSPEC_HIDDEN;
const char *debug_d3dpool(WINED3DPOOL pool) DECLSPEC_HIDDEN;
const char *debug_fbostatus(GLenum status) DECLSPEC_HIDDEN;
......
......@@ -548,29 +548,29 @@ enum wined3d_multisample_type
WINED3D_MULTISAMPLE_16_SAMPLES = 16,
};
typedef enum _WINED3DTEXTURESTAGESTATETYPE
{
WINED3DTSS_COLOROP = 0,
WINED3DTSS_COLORARG1 = 1,
WINED3DTSS_COLORARG2 = 2,
WINED3DTSS_ALPHAOP = 3,
WINED3DTSS_ALPHAARG1 = 4,
WINED3DTSS_ALPHAARG2 = 5,
WINED3DTSS_BUMPENVMAT00 = 6,
WINED3DTSS_BUMPENVMAT01 = 7,
WINED3DTSS_BUMPENVMAT10 = 8,
WINED3DTSS_BUMPENVMAT11 = 9,
WINED3DTSS_TEXCOORDINDEX = 10,
WINED3DTSS_BUMPENVLSCALE = 11,
WINED3DTSS_BUMPENVLOFFSET = 12,
WINED3DTSS_TEXTURETRANSFORMFLAGS = 13,
WINED3DTSS_COLORARG0 = 14,
WINED3DTSS_ALPHAARG0 = 15,
WINED3DTSS_RESULTARG = 16,
WINED3DTSS_CONSTANT = 17,
WINED3DTSS_FORCE_DWORD = 0x7fffffff
} WINED3DTEXTURESTAGESTATETYPE;
#define WINED3D_HIGHEST_TEXTURE_STATE WINED3DTSS_CONSTANT
enum wined3d_texture_stage_state
{
WINED3D_TSS_COLOR_OP = 0,
WINED3D_TSS_COLOR_ARG1 = 1,
WINED3D_TSS_COLOR_ARG2 = 2,
WINED3D_TSS_ALPHA_OP = 3,
WINED3D_TSS_ALPHA_ARG1 = 4,
WINED3D_TSS_ALPHA_ARG2 = 5,
WINED3D_TSS_BUMPENV_MAT00 = 6,
WINED3D_TSS_BUMPENV_MAT01 = 7,
WINED3D_TSS_BUMPENV_MAT10 = 8,
WINED3D_TSS_BUMPENV_MAT11 = 9,
WINED3D_TSS_TEXCOORD_INDEX = 10,
WINED3D_TSS_BUMPENV_LSCALE = 11,
WINED3D_TSS_BUMPENV_LOFFSET = 12,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS = 13,
WINED3D_TSS_COLOR_ARG0 = 14,
WINED3D_TSS_ALPHA_ARG0 = 15,
WINED3D_TSS_RESULT_ARG = 16,
WINED3D_TSS_CONSTANT = 17,
WINED3D_TSS_INVALID = ~0U,
};
#define WINED3D_HIGHEST_TEXTURE_STATE WINED3D_TSS_CONSTANT
typedef enum _WINED3DTEXTURETRANSFORMFLAGS
{
......@@ -2149,7 +2149,7 @@ UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *dev
HRESULT __cdecl wined3d_device_get_texture(const struct wined3d_device *device,
UINT stage, struct wined3d_texture **texture);
HRESULT __cdecl wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
UINT stage, WINED3DTEXTURESTAGESTATETYPE state, DWORD *value);
UINT stage, enum wined3d_texture_stage_state state, DWORD *value);
HRESULT __cdecl wined3d_device_get_transform(const struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE state, struct wined3d_matrix *matrix);
HRESULT __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device,
......@@ -2221,7 +2221,7 @@ HRESULT __cdecl wined3d_device_set_stream_source(struct wined3d_device *device,
HRESULT __cdecl wined3d_device_set_stream_source_freq(struct wined3d_device *device, UINT stream_idx, UINT divider);
HRESULT __cdecl wined3d_device_set_texture(struct wined3d_device *device, UINT stage, struct wined3d_texture *texture);
HRESULT __cdecl wined3d_device_set_texture_stage_state(struct wined3d_device *device,
UINT stage, WINED3DTEXTURESTAGESTATETYPE state, DWORD value);
UINT stage, enum wined3d_texture_stage_state state, DWORD value);
HRESULT __cdecl wined3d_device_set_transform(struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE state, const struct wined3d_matrix *matrix);
HRESULT __cdecl wined3d_device_set_vertex_declaration(struct wined3d_device *device,
......
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