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

wined3d: Get rid of the COMPARISON_TYPE typedef.

parent 323a9541
......@@ -2943,34 +2943,34 @@ static void shader_hw_break(const struct wined3d_shader_instruction *ins)
}
}
static const char *get_compare(COMPARISON_TYPE flags)
static const char *get_compare(enum wined3d_shader_rel_op op)
{
switch (flags)
switch (op)
{
case COMPARISON_GT: return "GT";
case COMPARISON_EQ: return "EQ";
case COMPARISON_GE: return "GE";
case COMPARISON_LT: return "LT";
case COMPARISON_NE: return "NE";
case COMPARISON_LE: return "LE";
case WINED3D_SHADER_REL_OP_GT: return "GT";
case WINED3D_SHADER_REL_OP_EQ: return "EQ";
case WINED3D_SHADER_REL_OP_GE: return "GE";
case WINED3D_SHADER_REL_OP_LT: return "LT";
case WINED3D_SHADER_REL_OP_NE: return "NE";
case WINED3D_SHADER_REL_OP_LE: return "LE";
default:
FIXME("Unrecognized comparison value: %u\n", flags);
FIXME("Unrecognized operator %#x.\n", op);
return "(\?\?)";
}
}
static COMPARISON_TYPE invert_compare(COMPARISON_TYPE flags)
static enum wined3d_shader_rel_op invert_compare(enum wined3d_shader_rel_op op)
{
switch (flags)
switch (op)
{
case COMPARISON_GT: return COMPARISON_LE;
case COMPARISON_EQ: return COMPARISON_NE;
case COMPARISON_GE: return COMPARISON_LT;
case COMPARISON_LT: return COMPARISON_GE;
case COMPARISON_NE: return COMPARISON_EQ;
case COMPARISON_LE: return COMPARISON_GT;
case WINED3D_SHADER_REL_OP_GT: return WINED3D_SHADER_REL_OP_LE;
case WINED3D_SHADER_REL_OP_EQ: return WINED3D_SHADER_REL_OP_NE;
case WINED3D_SHADER_REL_OP_GE: return WINED3D_SHADER_REL_OP_LT;
case WINED3D_SHADER_REL_OP_LT: return WINED3D_SHADER_REL_OP_GE;
case WINED3D_SHADER_REL_OP_NE: return WINED3D_SHADER_REL_OP_EQ;
case WINED3D_SHADER_REL_OP_LE: return WINED3D_SHADER_REL_OP_GT;
default:
FIXME("Unrecognized comparison value: %u\n", flags);
FIXME("Unrecognized operator %#x.\n", op);
return -1;
}
}
......
......@@ -1634,17 +1634,18 @@ static void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_in
}
}
static inline const char *shader_get_comp_op(DWORD op)
{
switch (op) {
case COMPARISON_GT: return ">";
case COMPARISON_EQ: return "==";
case COMPARISON_GE: return ">=";
case COMPARISON_LT: return "<";
case COMPARISON_NE: return "!=";
case COMPARISON_LE: return "<=";
static const char *shader_glsl_get_rel_op(enum wined3d_shader_rel_op op)
{
switch (op)
{
case WINED3D_SHADER_REL_OP_GT: return ">";
case WINED3D_SHADER_REL_OP_EQ: return "==";
case WINED3D_SHADER_REL_OP_GE: return ">=";
case WINED3D_SHADER_REL_OP_LT: return "<";
case WINED3D_SHADER_REL_OP_NE: return "!=";
case WINED3D_SHADER_REL_OP_LE: return "<=";
default:
FIXME("Unrecognized comparison value: %u\n", op);
FIXME("Unrecognized operator %#x.\n", op);
return "(\?\?)";
}
}
......@@ -2958,7 +2959,7 @@ static void shader_glsl_ifc(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param(ins, &ins->src[1], WINED3DSP_WRITEMASK_0, &src1_param);
shader_addline(ins->ctx->buffer, "if (%s %s %s) {\n",
src0_param.param_str, shader_get_comp_op(ins->flags), src1_param.param_str);
src0_param.param_str, shader_glsl_get_rel_op(ins->flags), src1_param.param_str);
}
static void shader_glsl_else(const struct wined3d_shader_instruction *ins)
......@@ -2981,7 +2982,7 @@ static void shader_glsl_breakc(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param(ins, &ins->src[1], WINED3DSP_WRITEMASK_0, &src1_param);
shader_addline(ins->ctx->buffer, "if (%s %s %s) break;\n",
src0_param.param_str, shader_get_comp_op(ins->flags), src1_param.param_str);
src0_param.param_str, shader_glsl_get_rel_op(ins->flags), src1_param.param_str);
}
static void shader_glsl_label(const struct wined3d_shader_instruction *ins)
......
......@@ -1439,12 +1439,12 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
{
switch (ins.flags)
{
case COMPARISON_GT: TRACE("_gt"); break;
case COMPARISON_EQ: TRACE("_eq"); break;
case COMPARISON_GE: TRACE("_ge"); break;
case COMPARISON_LT: TRACE("_lt"); break;
case COMPARISON_NE: TRACE("_ne"); break;
case COMPARISON_LE: TRACE("_le"); break;
case WINED3D_SHADER_REL_OP_GT: TRACE("_gt"); break;
case WINED3D_SHADER_REL_OP_EQ: TRACE("_eq"); break;
case WINED3D_SHADER_REL_OP_GE: TRACE("_ge"); break;
case WINED3D_SHADER_REL_OP_LT: TRACE("_lt"); break;
case WINED3D_SHADER_REL_OP_NE: TRACE("_ne"); break;
case WINED3D_SHADER_REL_OP_LE: TRACE("_le"); break;
default: TRACE("_(%u)", ins.flags);
}
}
......
......@@ -360,15 +360,15 @@ typedef enum _WINED3DSHADER_PARAM_DSTMOD_TYPE
#define WINED3DSI_TEXLD_PROJECT 1
#define WINED3DSI_TEXLD_BIAS 2
typedef enum COMPARISON_TYPE
{
COMPARISON_GT = 1,
COMPARISON_EQ = 2,
COMPARISON_GE = 3,
COMPARISON_LT = 4,
COMPARISON_NE = 5,
COMPARISON_LE = 6,
} COMPARISON_TYPE;
enum wined3d_shader_rel_op
{
WINED3D_SHADER_REL_OP_GT = 1,
WINED3D_SHADER_REL_OP_EQ = 2,
WINED3D_SHADER_REL_OP_GE = 3,
WINED3D_SHADER_REL_OP_LT = 4,
WINED3D_SHADER_REL_OP_NE = 5,
WINED3D_SHADER_REL_OP_LE = 6,
};
#define WINED3D_SM1_VS 0xfffe
#define WINED3D_SM1_PS 0xffff
......
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