tgsi: added tgsi_shader_info::indirect_files field
authorBrian Paul <brianp@vmware.com>
Wed, 21 Jul 2010 15:51:11 +0000 (09:51 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 21 Jul 2010 16:16:32 +0000 (10:16 -0600)
Indicates which register files are accessed with indirect addressing.

src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index ced9c94f46887f281b212c42f2833dcc8ee324cb..90198a4f6049a6f265da80648b84c9865f086087 100644 (file)
@@ -109,6 +109,19 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                      info->input_usage_mask[ind] |= usage_mask;
                   }
                }
+
+               /* check for indirect register reads */
+               if (src->Register.Indirect) {
+                  info->indirect_files |= (1 << src->Register.File);
+               }
+            }
+
+            /* check for indirect register writes */
+            for (i = 0; i < fullinst->Instruction.NumDstRegs; i++) {
+               const struct tgsi_full_dst_register *dst = &fullinst->Dst[i];
+               if (dst->Register.Indirect) {
+                  info->indirect_files |= (1 << dst->Register.File);
+               }
             }
 
             info->num_instructions++;
index e75280336f0d4f987413d23d80f429fb7bc8933a..f8aa90cf065095cbbde51601fc30cab11870793b 100644 (file)
@@ -63,6 +63,12 @@ struct tgsi_shader_info
    boolean writes_edgeflag; /**< vertex shader outputs edgeflag */
    boolean uses_kill;  /**< KIL or KILP instruction used? */
 
+   /**
+    * Bitmask indicating which register files are accessed with
+    * indirect addressing.  The bits are (1 << TGSI_FILE_x), etc.
+    */
+   unsigned indirect_files;
+
    struct {
       unsigned name;
       unsigned data[8];