[PATCH 1/2] wined3d: Fix handling of cnd instruction with coissue flag. (try 2)
Matteo Bruni
mbruni at codeweavers.com
Tue Jun 25 12:23:18 CDT 2013
Fixes bug 12771 (well, at least what the bug was originally about i.e.
the first few comments).
---
dlls/wined3d/arb_program_shader.c | 4 ++--
dlls/wined3d/glsl_shader.c | 7 ++-----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index a9894da..b7f5ffd 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -1630,8 +1630,8 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
shader_arb_get_dst_param(ins, dst, dst_name);
shader_arb_get_src_param(ins, &ins->src[1], 1, src_name[1]);
- /* The coissue flag changes the semantic of the cnd instruction in <= 1.3 shaders */
- if (shader_version <= WINED3D_SHADER_VERSION(1, 3) && ins->coissue)
+ if (shader_version <= WINED3D_SHADER_VERSION(1, 3) && ins->coissue
+ && ins->dst->write_mask != WINED3DSP_WRITEMASK_3)
{
shader_addline(buffer, "MOV%s %s, %s;\n", shader_arb_get_modifier(ins), dst_name, src_name[1]);
}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index ad9be6a..98671aa 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -3029,14 +3029,11 @@ static void shader_glsl_cnd(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param(ins, &ins->src[1], write_mask, &src1_param);
shader_glsl_add_src_param(ins, &ins->src[2], write_mask, &src2_param);
- /* Fun: The D3DSI_COISSUE flag changes the semantic of the cnd instruction for < 1.4 shaders */
- if (ins->coissue)
- {
+ if (ins->coissue && ins->dst->write_mask != WINED3DSP_WRITEMASK_3)
shader_addline(ins->ctx->buffer, "%s /* COISSUE! */);\n", src1_param.param_str);
- } else {
+ else
shader_addline(ins->ctx->buffer, "%s > 0.5 ? %s : %s);\n",
src0_param.param_str, src1_param.param_str, src2_param.param_str);
- }
return;
}
--
1.8.1.5
More information about the wine-patches
mailing list