diff options
author | Rob Clark <robclark@freedesktop.org> | 2015-04-16 15:16:12 -0400 |
---|---|---|
committer | Rob Clark <robclark@freedesktop.org> | 2015-04-17 10:34:15 -0400 |
commit | 7a9063e7c735960d10f489314aa7623a3d262085 (patch) | |
tree | c3c90369b52338d51abddaa306d40b96883ecb3a /src/gallium/auxiliary/nir/tgsi_to_nir.c | |
parent | ef7c4f39bf26998f24999f03b313d2665e842d31 (diff) | |
download | external_mesa3d-7a9063e7c735960d10f489314aa7623a3d262085.zip external_mesa3d-7a9063e7c735960d10f489314aa7623a3d262085.tar.gz external_mesa3d-7a9063e7c735960d10f489314aa7623a3d262085.tar.bz2 |
gallium/ttn: fix TXF
There is a level param stashed away in the .w component of the first
src.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/gallium/auxiliary/nir/tgsi_to_nir.c')
-rw-r--r-- | src/gallium/auxiliary/nir/tgsi_to_nir.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 6c8d3fc..59aaf67 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -1053,7 +1053,7 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) break; case TGSI_OPCODE_TXF: op = nir_texop_txf; - num_srcs = 1; + num_srcs = 2; break; case TGSI_OPCODE_TXD: op = nir_texop_txd; @@ -1138,6 +1138,12 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) src_number++; } + if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXF) { + instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[0], W)); + instr->src[src_number].src_type = nir_tex_src_lod; + src_number++; + } + if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXD) { instr->src[src_number].src = nir_src_for_ssa(nir_swizzle(b, src[1], SWIZ(X, Y, Z, W), |