diff options
author | Jason Ekstrand <[email protected]> | 2019-05-06 10:20:23 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-05-24 08:38:11 -0500 |
commit | 6c2ca2a5d33cdfc4202ebb0df54567b587ecc578 (patch) | |
tree | f37cce2c6c44c3f08b028300d0b9ed0321dfb0d9 | |
parent | 88eb2a1f7e6277c7f10adfc95ebeaf3d2f73e862 (diff) |
ptn,ttn: Use nir_channel for selecting channels
Both of these passes predate the nir_channel helper. We should just use
it instead of hand-rolling it in both passes.
Reviewed-by: Kristian H. Kristensen <[email protected]>
Acked-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/auxiliary/nir/tgsi_to_nir.c | 2 | ||||
-rw-r--r-- | src/mesa/program/prog_to_nir.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index aa9321f2be4..09d7798b08d 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -109,7 +109,7 @@ struct ttn_compile { #define ttn_swizzle(b, src, x, y, z, w) \ nir_swizzle(b, src, SWIZ(x, y, z, w), 4, false) #define ttn_channel(b, src, swiz) \ - nir_swizzle(b, src, SWIZ(swiz, swiz, swiz, swiz), 1, false) + nir_channel(b, src, TGSI_SWIZZLE_##swiz) static gl_varying_slot tgsi_varying_semantic_to_slot(unsigned semantic, unsigned index) diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index dda3cd91da9..52a1253230c 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -62,7 +62,7 @@ struct ptn_compile { #define SWIZ(X, Y, Z, W) \ (unsigned[4]){ SWIZZLE_##X, SWIZZLE_##Y, SWIZZLE_##Z, SWIZZLE_##W } -#define ptn_channel(b, src, ch) nir_swizzle(b, src, SWIZ(ch, ch, ch, ch), 1, true) +#define ptn_channel(b, src, ch) nir_channel(b, src, SWIZZLE_##ch) static nir_ssa_def * ptn_src_for_dest(struct ptn_compile *c, nir_alu_dest *dest) |