ttn: fix txd src sizes
authorRob Clark <robdclark@gmail.com>
Mon, 15 May 2017 17:24:34 +0000 (13:24 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 16 May 2017 20:34:21 +0000 (16:34 -0400)
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/nir/tgsi_to_nir.c

index 3b8e321..bdcf218 100644 (file)
@@ -1411,15 +1411,17 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
    }
 
    if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXD) {
+      instr->src[src_number].src_type = nir_tex_src_ddx;
       instr->src[src_number].src =
          nir_src_for_ssa(nir_swizzle(b, src[1], SWIZ(X, Y, Z, W),
-              instr->coord_components, false));
-      instr->src[src_number].src_type = nir_tex_src_ddx;
+                                    nir_tex_instr_src_size(instr, src_number),
+                                    false));
       src_number++;
+      instr->src[src_number].src_type = nir_tex_src_ddy;
       instr->src[src_number].src =
          nir_src_for_ssa(nir_swizzle(b, src[2], SWIZ(X, Y, Z, W),
-              instr->coord_components, false));
-      instr->src[src_number].src_type = nir_tex_src_ddy;
+                                    nir_tex_instr_src_size(instr, src_number),
+                                    false));
       src_number++;
    }