From 563edce2fa6d116c94598fb99de4dfdad6720acf Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 14 Nov 2011 21:11:42 +0100 Subject: [PATCH] wined3d: Get rid of the WINED3DSHADER_PARAM_SRCMOD_TYPE typedef. --- dlls/wined3d/arb_program_shader.c | 5 +++-- dlls/wined3d/glsl_shader.c | 11 +++++++---- dlls/wined3d/shader.c | 2 +- dlls/wined3d/wined3d_private.h | 6 +++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 19e565e4900..17c5ba45c08 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -1951,8 +1951,9 @@ static void pshader_hw_tex(const struct wined3d_shader_instruction *ins) } else if (shader_version < WINED3D_SHADER_VERSION(2,0)) { - DWORD src_mod = ins->src[0].modifiers; - if (src_mod == WINED3DSPSM_DZ) { + enum wined3d_shader_src_modifier src_mod = ins->src[0].modifiers; + if (src_mod == WINED3DSPSM_DZ) + { /* TXP cannot handle DZ natively, so move the z coordinate to .w. reg_coord is a read-only * varying register, so we need a temp reg */ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index ff17fcfdb46..1746cb44c64 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1234,7 +1234,8 @@ static const char * const shift_glsl_tab[] = { }; /* Generate a GLSL parameter that does the input modifier computation and return the input register/mask to use */ -static void shader_glsl_gen_modifier(DWORD src_modifier, const char *in_reg, const char *in_regswizzle, char *out_str) +static void shader_glsl_gen_modifier(enum wined3d_shader_src_modifier src_modifier, + const char *in_reg, const char *in_regswizzle, char *out_str) { out_str[0] = 0; @@ -3054,7 +3055,7 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins) } else if (shader_version < WINED3D_SHADER_VERSION(2,0)) { - DWORD src_mod = ins->src[0].modifiers; + enum wined3d_shader_src_modifier src_mod = ins->src[0].modifiers; if (src_mod == WINED3DSPSM_DZ) { sample_flags |= WINED3D_GLSL_SAMPLE_PROJECTED; @@ -3187,9 +3188,11 @@ static void shader_glsl_texcoord(const struct wined3d_shader_instruction *ins) shader_glsl_get_write_mask(&ins->dst[0], dst_mask); shader_addline(buffer, "clamp(gl_TexCoord[%u], 0.0, 1.0)%s);\n", ins->dst[0].reg.idx, dst_mask); - } else { + } + else + { + enum wined3d_shader_src_modifier src_mod = ins->src[0].modifiers; DWORD reg = ins->src[0].reg.idx; - DWORD src_mod = ins->src[0].modifiers; char dst_swizzle[6]; shader_glsl_get_swizzle(&ins->src[0], FALSE, write_mask, dst_swizzle); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 24b577aca53..447de8f8ca5 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1099,7 +1099,7 @@ void shader_dump_dst_param(const struct wined3d_shader_dst_param *param, void shader_dump_src_param(const struct wined3d_shader_src_param *param, const struct wined3d_shader_version *shader_version) { - DWORD src_modifier = param->modifiers; + enum wined3d_shader_src_modifier src_modifier = param->modifiers; DWORD swizzle = param->swizzle; if (src_modifier == WINED3DSPSM_NEG diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index a331f4e58a7..460c911e69e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -324,7 +324,7 @@ enum wined3d_immconst_type #define WINED3DSP_NOSWIZZLE (0 | (1 << 2) | (2 << 4) | (3 << 6)) -typedef enum _WINED3DSHADER_PARAM_SRCMOD_TYPE +enum wined3d_shader_src_modifier { WINED3DSPSM_NONE = 0, WINED3DSPSM_NEG = 1, @@ -340,7 +340,7 @@ typedef enum _WINED3DSHADER_PARAM_SRCMOD_TYPE WINED3DSPSM_ABS = 11, WINED3DSPSM_ABSNEG = 12, WINED3DSPSM_NOT = 13, -} WINED3DSHADER_PARAM_SRCMOD_TYPE; +}; #define WINED3DSP_WRITEMASK_0 0x1 /* .x r */ #define WINED3DSP_WRITEMASK_1 0x2 /* .y g */ @@ -617,7 +617,7 @@ struct wined3d_shader_src_param { struct wined3d_shader_register reg; DWORD swizzle; - DWORD modifiers; + enum wined3d_shader_src_modifier modifiers; }; struct wined3d_shader_instruction