diff options
author | marha <marha@users.sourceforge.net> | 2015-04-30 23:24:30 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-04-30 23:24:30 +0200 |
commit | a71d524ecad48837e0124a03124bc05f59a48be7 (patch) | |
tree | 87c5ba1711e03cb9692e23cc685b938571b52d76 /mesalib/src/mesa/program/prog_to_nir.c | |
parent | 2a00e489122f6c4b525090dbdba2855a2ea2d519 (diff) | |
download | vcxsrv-a71d524ecad48837e0124a03124bc05f59a48be7.tar.gz vcxsrv-a71d524ecad48837e0124a03124bc05f59a48be7.tar.bz2 vcxsrv-a71d524ecad48837e0124a03124bc05f59a48be7.zip |
fontconfig pixman libX11 mesa git update 30 Apr 2015
libX11 commit d3415d1f052530760b4617db45affcb984cfe35c
pixman commit e0c0153d8e5d42c08c2b9bd2cf2123bff2c48d75
fontconfig commit 4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd
mesa commit 1ac7db07b363207e8ded9259f84bbcaa084b8667
Diffstat (limited to 'mesalib/src/mesa/program/prog_to_nir.c')
-rw-r--r-- | mesalib/src/mesa/program/prog_to_nir.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/mesalib/src/mesa/program/prog_to_nir.c b/mesalib/src/mesa/program/prog_to_nir.c index c738f5073..ff3d9f3be 100644 --- a/mesalib/src/mesa/program/prog_to_nir.c +++ b/mesalib/src/mesa/program/prog_to_nir.c @@ -222,12 +222,23 @@ ptn_get_src(struct ptn_compile *c, const struct prog_src_register *prog_src) } nir_ssa_def *def; - if (!HAS_EXTENDED_SWIZZLE(prog_src->Swizzle)) { + if (!HAS_EXTENDED_SWIZZLE(prog_src->Swizzle) && + (prog_src->Negate == NEGATE_NONE || prog_src->Negate == NEGATE_XYZW)) { + /* The simple non-SWZ case. */ for (int i = 0; i < 4; i++) src.swizzle[i] = GET_SWZ(prog_src->Swizzle, i); def = nir_fmov_alu(b, src, 4); + + if (prog_src->Abs) + def = nir_fabs(b, def); + + if (prog_src->Negate) + def = nir_fneg(b, def); } else { + /* The SWZ instruction allows per-component zero/one swizzles, and also + * per-component negation. + */ nir_ssa_def *chans[4]; for (int i = 0; i < 4; i++) { int swizzle = GET_SWZ(prog_src->Swizzle, i); @@ -246,16 +257,16 @@ ptn_get_src(struct ptn_compile *c, const struct prog_src_register *prog_src) chans[i] = &mov->dest.dest.ssa; } + + if (prog_src->Abs) + chans[i] = nir_fabs(b, chans[i]); + + if (prog_src->Negate & (1 << i)) + chans[i] = nir_fneg(b, chans[i]); } def = nir_vec4(b, chans[0], chans[1], chans[2], chans[3]); } - if (prog_src->Abs) - def = nir_fabs(b, def); - - if (prog_src->Negate) - def = nir_fneg(b, def); - return def; } |