Stefan Dösinger : wined3d: CMP supports _SAT.
Alexandre Julliard
julliard at winehq.org
Wed May 25 11:28:15 CDT 2011
Module: wine
Branch: master
Commit: dbd878639424071e1d4c6cfc9bcc75906a4b2b8a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=dbd878639424071e1d4c6cfc9bcc75906a4b2b8a
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sun May 22 13:54:57 2011 +0200
wined3d: CMP supports _SAT.
This is a partial revert of c9ef1ed28c861bc862c92ff68aa37b4ddf01cc39. 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.
---
dlls/wined3d/arb_program_shader.c | 28 +++++++---------------------
1 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index cefb6e5..55435d4 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -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.
More information about the wine-cvs
mailing list