diff options
author | Axel Davy <[email protected]> | 2014-12-25 11:37:28 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-01-22 23:43:27 +0000 |
commit | d0d09a4eee93fd4b319206004606c01ce73d8609 (patch) | |
tree | 1c95c5d1b15e6d5d345d7c300b01e0ea3a998df7 /src | |
parent | 75f39e45f01be680f1c042d0a6f00cd27db0c08e (diff) |
st/nine: Fix CND implementation
Signed-off-by: Axel Davy <[email protected]>
Signed-off-by: Tiziano Bacocco <[email protected]>
Cc: "10.4" <[email protected]>
(cherry picked from commit 3ca67f881040b4f3ecdf9b91a7f3f0bf51cf1544)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 5342b101935..9873373c6dc 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -1384,7 +1384,13 @@ DECL_SPECIAL(CND) struct ureg_dst cgt; struct ureg_src cnd; - if (tx->insn.coissue && tx->version.major == 1 && tx->version.minor < 4) { + /* the coissue flag was a tip for compilers to advise to + * execute two operations at the same time, in cases + * the two executions had same dst with different channels. + * It has no effect on current hw. However it seems CND + * is affected. The handling of this very specific case + * handled below mimick wine behaviour */ + if (tx->insn.coissue && tx->version.major == 1 && tx->version.minor < 4 && tx->insn.dst[0].mask != NINED3DSP_WRITEMASK_3) { ureg_MOV(tx->ureg, dst, tx_src_param(tx, &tx->insn.src[1])); return D3D_OK; @@ -1393,16 +1399,14 @@ DECL_SPECIAL(CND) cnd = tx_src_param(tx, &tx->insn.src[0]); cgt = tx_scratch(tx); - if (tx->version.major == 1 && tx->version.minor < 4) { - cgt.WriteMask = TGSI_WRITEMASK_W; - ureg_SGT(tx->ureg, cgt, cnd, ureg_imm1f(tx->ureg, 0.5f)); + if (tx->version.major == 1 && tx->version.minor < 4) cnd = ureg_scalar(cnd, TGSI_SWIZZLE_W); - } else { - ureg_SGT(tx->ureg, cgt, cnd, ureg_imm1f(tx->ureg, 0.5f)); - } - ureg_CMP(tx->ureg, dst, + + ureg_SGT(tx->ureg, cgt, cnd, ureg_imm1f(tx->ureg, 0.5f)); + + ureg_CMP(tx->ureg, dst, ureg_negate(ureg_src(cgt)), tx_src_param(tx, &tx->insn.src[1]), - tx_src_param(tx, &tx->insn.src[2]), ureg_negate(cnd)); + tx_src_param(tx, &tx->insn.src[2])); return D3D_OK; } |