[Mesa-stable] [Mesa-dev] [PATCH 29/53] st/nine: Fix CND implementation
Ilia Mirkin
imirkin at alum.mit.edu
Wed Jan 7 16:48:04 PST 2015
On Wed, Jan 7, 2015 at 11:36 AM, Axel Davy <axel.davy at ens.fr> wrote:
> Signed-off-by: Axel Davy <axel.davy at ens.fr>
> Signed-off-by: Tiziano Bacocco <tizbac2 at gmail.com>
>
> Cc: "10.4" <mesa-stable at lists.freedesktop.org>
> ---
> src/gallium/state_trackers/nine/nine_shader.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
> index 88d4c07..8bcf67b 100644
> --- a/src/gallium/state_trackers/nine/nine_shader.c
> +++ b/src/gallium/state_trackers/nine/nine_shader.c
> @@ -1394,7 +1394,7 @@ DECL_SPECIAL(CND)
> struct ureg_dst cgt;
> struct ureg_src cnd;
>
> - if (tx->insn.coissue && tx->version.major == 1 && tx->version.minor < 4) {
> + 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]));
Why is dst mask != .a important here?
> return D3D_OK;
> @@ -1403,16 +1403,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;
> }
>
> --
> 2.1.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-stable
mailing list