Commit dbd87863 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: CMP supports _SAT.

This is a partial revert of c9ef1ed2. I don't know where I got the idea that CMP does not support _SAT, but I suspect that my driver at the time was broken.
parent 934a64cb
......@@ -1588,7 +1588,6 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
char src_name[3][50];
DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major,
ins->ctx->reg_maps->shader_version.minor);
BOOL is_color;
shader_arb_get_dst_param(ins, dst, dst_name);
shader_arb_get_src_param(ins, &ins->src[1], 1, src_name[1]);
......@@ -1597,7 +1596,9 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
if (shader_version <= WINED3D_SHADER_VERSION(1, 3) && ins->coissue)
{
shader_addline(buffer, "MOV%s %s, %s;\n", shader_arb_get_modifier(ins), dst_name, src_name[1]);
} else {
}
else
{
struct wined3d_shader_src_param src0_copy = ins->src[0];
char extra_neg;
......@@ -1607,15 +1608,8 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
shader_arb_get_src_param(ins, &src0_copy, 0, src_name[0]);
shader_arb_get_src_param(ins, &ins->src[2], 2, src_name[2]);
shader_addline(buffer, "ADD TA, %c%s, coefdiv.x;\n", extra_neg, src_name[0]);
/* No modifiers supported on CMP */
shader_addline(buffer, "CMP %s, TA, %s, %s;\n", dst_name, src_name[1], src_name[2]);
/* _SAT on CMP doesn't make much sense, but it is not a pure NOP */
if(ins->dst[0].modifiers & WINED3DSPDM_SATURATE)
{
shader_arb_get_register_name(ins, &dst->reg, src_name[0], &is_color);
shader_addline(buffer, "MOV_SAT %s, %s;\n", dst_name, dst_name);
}
shader_addline(buffer, "CMP%s %s, TA, %s, %s;\n", shader_arb_get_modifier(ins),
dst_name, src_name[1], src_name[2]);
}
}
......@@ -1625,7 +1619,6 @@ static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50];
char src_name[3][50];
BOOL is_color;
shader_arb_get_dst_param(ins, dst, dst_name);
......@@ -1634,15 +1627,8 @@ static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
shader_arb_get_src_param(ins, &ins->src[1], 1, src_name[1]);
shader_arb_get_src_param(ins, &ins->src[2], 2, src_name[2]);
/* No modifiers are supported on CMP */
shader_addline(buffer, "CMP %s, %s, %s, %s;\n", dst_name,
src_name[0], src_name[2], src_name[1]);
if(ins->dst[0].modifiers & WINED3DSPDM_SATURATE)
{
shader_arb_get_register_name(ins, &dst->reg, src_name[0], &is_color);
shader_addline(buffer, "MOV_SAT %s, %s;\n", dst_name, src_name[0]);
}
shader_addline(buffer, "CMP%s %s, %s, %s, %s;\n", shader_arb_get_modifier(ins),
dst_name, src_name[0], src_name[2], src_name[1]);
}
/** Process the WINED3DSIO_DP2ADD instruction in ARB.
......
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