gallium/ttn: add support for TXL2
authorRob Clark <robclark@freedesktop.org>
Sat, 11 Apr 2015 15:37:12 +0000 (11:37 -0400)
committerRob Clark <robclark@freedesktop.org>
Fri, 17 Apr 2015 14:34:15 +0000 (10:34 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/nir/tgsi_to_nir.c

index 7312e54aefb1e07a6025387b1e8ae38a3f2b168f..42671c8bb18f955d1ed02ce2b6e59ca546a63638 100644 (file)
@@ -1001,6 +1001,11 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
       op = nir_texop_txl;
       num_srcs = 2;
       break;
+   case TGSI_OPCODE_TXL2:
+      op = nir_texop_txl;
+      num_srcs = 2;
+      samp = 2;
+      break;
    case TGSI_OPCODE_TXF:
       op = nir_texop_txf;
       num_srcs = 1;
@@ -1082,6 +1087,12 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
       src_number++;
    }
 
+   if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXL2) {
+      instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[1], X));
+      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),