tgsi/scan: scan texture offset operands
authorMarek Olšák <marek.olsak@amd.com>
Wed, 19 Oct 2016 23:22:07 +0000 (01:22 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 24 Oct 2016 19:41:38 +0000 (21:41 +0200)
This seems important considering how much we depend on some of the flags.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c

index 00f55c75cc6e399acb2f1a26cf9f230d7dbf94a7..cbb3eec07fbabafb21521871943d105fd40ac216 100644 (file)
@@ -368,6 +368,22 @@ scan_instruction(struct tgsi_shader_info *info,
                        is_interp_instruction, &is_mem_inst);
    }
 
+   if (fullinst->Instruction.Texture) {
+      for (i = 0; i < fullinst->Texture.NumOffsets; i++) {
+         struct tgsi_full_src_register src = {};
+
+         src.Register.File = fullinst->TexOffsets[i].File;
+         src.Register.Index = fullinst->TexOffsets[i].Index;
+         src.Register.SwizzleX = fullinst->TexOffsets[i].SwizzleX;
+         src.Register.SwizzleY = fullinst->TexOffsets[i].SwizzleY;
+         src.Register.SwizzleZ = fullinst->TexOffsets[i].SwizzleZ;
+
+         /* The usage mask is suboptimal but should be safe. */
+         scan_src_operand(info, fullinst, &src, 0, TGSI_WRITEMASK_XYZ,
+                          false, &is_mem_inst);
+      }
+   }
+
    /* check for indirect register writes */
    for (i = 0; i < fullinst->Instruction.NumDstRegs; i++) {
       const struct tgsi_full_dst_register *dst = &fullinst->Dst[i];